Skip to content

Instantly share code, notes, and snippets.

@OrkoHunter
Created December 20, 2017 20:32
Show Gist options
  • Save OrkoHunter/09edb7ada76078f36f54f95ce0457a87 to your computer and use it in GitHub Desktop.
Save OrkoHunter/09edb7ada76078f36f54f95ce0457a87 to your computer and use it in GitHub Desktop.
Tampermonkey script to remove Unread Mentions on Slack due to slackbot
// ==UserScript==
// @name block-slackbot
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author @OrkoHunter
// @match https://kossiitkgp.slack.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
document.addEventListener("DOMContentLoaded", function(event) {
var removeUnreadMentions = function() {
var listOfButtons = document.getElementsByClassName("p-channel_sidebar__banner--mentions");
console.log("yolo listOfButtons ", listOfButtons);
for (let l of listOfButtons) {
if (l.dataset.qaLinkedId == "D0H8R7Y7P") {
console.log("yolo found it");
l.style.visibility = 'hidden';
}
}
};
var element = document.getElementsByClassName("client_channels_list_container")[0];
console.log("yolo element is ", element);
removeUnreadMentions();
element.onmousewheel = removeUnreadMentions;
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment