User:Nyakase/Scripts/titlenotifs.js

const originalTitle = document.title;

if(mw.config.get("skin") != "minerva") { setInterval( => {	   let currentNotifs = parseInt(document.querySelectorAll(".mw-echo-notifications-badge")[0].getAttribute("data-counter-num")) + parseInt(document.querySelectorAll(".mw-echo-notifications-badge")[1].getAttribute("data-counter-num"));	    if(currentNotifs != 0) {	        document.title = `(${currentNotifs}) ${originalTitle}`;	    } else {	        document.title = originalTitle;	    }	}, 1); }