/** * Updates the document title to show a prefixed number indicating the number of new * changes when the watchlist undergoes a live update * * Should work on any wiki. * * Per request by Jürgen Eissink * [[Wikipedia:User_scripts/Requests/Archive_4#Watchlist_notifier:_number_of_(automated)_updates_in_browser_page_title]] * */if (mw.config.get('wgCanonicalSpecialPageName') === 'Watchlist') {// Enable "Live updates" every time$.ready.then(function() { $('a:contains("' + mw.messages.get('rcfilters-liveupdates-button') + '")').click(); });var watchlistUpdateNumber = 0;var watchlistHeading = document.title;var markSeenButtonPressed = false;$('.mw-rcfilters-ui-markSeenButtonWidget').on('click', function() {markSeenButtonPressed = true;});mw.hook('wikipage.content').add(function($content) {if (!$content.hasClass('mw-rcfilters-ui-changesListWrapperWidget')) {return;}// Handle the hook being fired just after the "Mark all changes as seen" is clickedif (markSeenButtonPressed) {watchlistUpdateNumber = 0;document.title = watchlistHeading;markSeenButtonPressed = false;return;}$content.find('ul.special').children().each(function(i, e) {// exit on reaching the horizontal line separator if (e.tagName === 'DIV') return false; // don't increment counter on one's own edits if (e.querySelector('bdi').textContent !== mw.config.get('wgUserName')) { watchlistUpdateNumber += 1; } });if (watchlistUpdateNumber > 0) {document.title = '(' + watchlistUpdateNumber + ') ' + watchlistHeading;}});$(window).focus(function() {watchlistUpdateNumber = 0;document.title = watchlistHeading;});}
🔥 Top keywords: Main PageSpecial:SearchPage 3Wikipedia:Featured picturesHouse of the DragonUEFA Euro 2024Bryson DeChambeauJuneteenthInside Out 2Eid al-AdhaCleopatraDeaths in 2024Merrily We Roll Along (musical)Jonathan GroffJude Bellingham.xxx77th Tony AwardsBridgertonGary PlauchéKylian MbappéDaniel RadcliffeUEFA European Championship2024 ICC Men's T20 World CupUnit 731The Boys (TV series)Rory McIlroyN'Golo KantéUEFA Euro 2020YouTubeRomelu LukakuOpinion polling for the 2024 United Kingdom general electionThe Boys season 4Romania national football teamNicola CoughlanStereophonic (play)Gene WilderErin DarkeAntoine GriezmannProject 2025