Wikipedia:WikiProject User scripts/Scripts/Watchlist since
// Adds a "Changes since last load" link to your watchlist.
addOnloadHook(function () { if (unescape(window.___location.href).indexOf("Special:Watchlist") < 0) return; // just one little ID attribute would be _so_ nice... var wlNotePara = document.getElementsByTagName('hr')[0]; while (wlNotePara && !(wlNotePara.tagName && wlNotePara.tagName.toLowerCase() == 'p')) wlNotePara = wlNotePara.nextSibling; if (!wlNotePara) return; var link = document.createElement('a'); link.id = 'listSince'; link.href = '#listSince'; // must have a href to show as link! var then = +(new Date()); var fixLinkHref = function () { var url = window.___location.href.split('#')[0]; var days = ( +(new Date()) - then )/(1000 * 3600 * 24); if (url.match(/[?&]days=/)) this.href = url.replace(/([?&]days=)[^&]*/, '$1'+days); else this.href = url + (url.indexOf('?') < 0 ? '?':'&') + 'days=' + days; return true; }; link.onclick = fixLinkHref; link.onmousedown = fixLinkHref; // react to middle clicks too wlNotePara.appendChild(document.createElement('br')); wlNotePara.appendChild(link); link.appendChild(document.createTextNode('Changes')); wlNotePara.appendChild(document.createTextNode(' since last load.')); }); //