-
Notifications
You must be signed in to change notification settings - Fork 0
/
tampermonkey.user.js
33 lines (28 loc) · 1.48 KB
/
tampermonkey.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// ==UserScript==
// @name WhatsApp Web No Distraction
// @namespace https://github.com/hmaesta/whatsapp-web-no-distraction
// @version 0.2
// @description Stop being distracted by WhatsApp notification icon
// @author H.Maestá
// @match https://web.whatsapp.com
// @grant none
// @downloadURL https://raw.githubusercontent.com/hmaesta/whatsapp-web-no-distraction/master/tampermonkey.user.js
// @updateURL https://raw.githubusercontent.com/hmaesta/whatsapp-web-no-distraction/master/tampermonkey.user.js
// ==/UserScript==
(function() {
'use strict';
var faviconElement = document.querySelector("link[rel*='icon']") || document.createElement('link'),
faviconURL = "https://web.whatsapp.com/img/94e99ab189284094867d2e1220e42e9f.png",
cycleTime = 1500;
console.log('%c✅ WhatsApp Web No Distraction','padding:0.25rem 0.15rem;background:#e4ffe5;color:green;font-size:0.85rem;font-weight:bold;');
console.log('%c↳ Refreshing every ' + cycleTime + 'ms','padding:0.25rem 0.15rem;background:#f4f4f4;color:#999;font-size:0.75rem;');
function resetWhatsApp () {
document.title = "WhatsApp Web";
faviconElement.type = 'image/x-icon';
faviconElement.rel = 'shortcut icon';
faviconElement.href = faviconURL;
faviconElement.classList.add("whatsapp-web-no-distraction");
document.getElementsByTagName('head')[0].appendChild(faviconElement);
};
setInterval(resetWhatsApp, cycleTime);
})();