commit ae1db6e36717fe3021a05755f3db9b4d2454c1bc Author: worm Date: Tue Nov 14 14:26:00 2023 -0800 initial working version diff --git a/README.md b/README.md new file mode 100644 index 0000000..1f64d1e --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +a flood of unnecessary sev2 notifications from a Zapier bot ruining your entire life? + +Try installing this Tampermonkey script. + +For the full app (tm) experience, run it in chrome like: +`nohup google-chrome --app=https://app.slack.com &` + +(works on linux idk about anywhere else)` diff --git a/foz.user.js b/foz.user.js new file mode 100644 index 0000000..80b8037 --- /dev/null +++ b/foz.user.js @@ -0,0 +1,27 @@ +// ==UserScript== +// @name Zapier, why won't u just leave me alone? +// @namespace http://git.minimally.online/ +// @version 0.1 +// @description Allows you to hide Slack messages from needlessly noisy apps/individuals based on content +// @author drudgesentinel (Sean) +// @match *://app.slack.com/* +// @icon https://i.postimg.cc/NGb9WSWn/is-it-joy.png +// @grant none +// ==/UserScript== + +//going to eventually want to check if the terraform-support is highlighted, probably. We'll see. + +const removeMessages = () => { + const messages = Array.from(document.querySelectorAll('[data-qa="virtual-list-item"]')); + const haveButtons = messages.filter(message => message.querySelector('button')); + haveButtons.forEach( (node) => removeIfSpam(node, "SEV2 Handoff Candidate")); +} + +const removeIfSpam = (node, spamMessage) => { + if(node.querySelector('button').textContent.includes(spamMessage)) { + node.replaceChildren(); +} + } + + //adjust this, faster is better but might impact performance idk +setInterval( removeMessages, 500); \ No newline at end of file