Last active
May 13, 2016 15:07
-
-
Save tjperovich/45dfc7ba1a3ef487df6f to your computer and use it in GitHub Desktop.
Prevents Slack Desktop Notifications from closing themselves after 5/10 seconds has passed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Persist Slack Desktop Notification | |
// @version 1.0 | |
// @author TJP | |
// @match https://custom-domain.slack.com/messages/* | |
// @description Prevents Slack notifications from closing themselves. | |
// @grant none | |
// ==/UserScript== | |
window.oldSetTimeout = window.setTimeout; | |
window.setTimeout = function(func, delay) { | |
/* | |
* Even though the code reads: | |
* "function(){" | |
* we need to add a space since the js engine converts it to: | |
* "function (){" | |
*/ | |
if (func && (func + '').indexOf("function (){if(f.cancel){f.cance")==0) | |
return; | |
return window.oldSetTimeout(func, delay); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment