From 0fde7b618f2a4af5886b0f3afdcf91cbd5d8a51b Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Sun, 14 Jul 2019 11:48:15 +0200 Subject: [PATCH] Hide notification count in tab title --- youtube-addiction-control-extension-firefox.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/youtube-addiction-control-extension-firefox.js b/youtube-addiction-control-extension-firefox.js index 4cbdf59..8cbe82c 100644 --- a/youtube-addiction-control-extension-firefox.js +++ b/youtube-addiction-control-extension-firefox.js @@ -97,4 +97,14 @@ function modifyThings() { showMoreButton[0].click(); } } -modifyThings(); \ No newline at end of file +modifyThings(); + +// attempt to hide the notification count in the title + +function hideNotificationCount() { + let a = document.getElementsByTagName("title")[0]; + if (a.innerText.match("^\\(\\d+\\).*")) { + a.innerText = a.innerText.substr(a.innerText.indexOf(")") + 2); + } +} +setInterval(hideNotificationCount, 1000); \ No newline at end of file