Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
//This code adds an 'unwatch' link to each item on watchlist.addOnloadHook(function(){// Check if we're on the watchlistif(!wgCanonicalSpecialPageName||wgCanonicalSpecialPageName!="Watchlist")return;if(!document.forms[0]||!document.forms[0].namespace)return;// Unwatch links go back to watchlist with "Removing requested items from watchlist..." messagevarquery_prefix="title="+encodeURIComponent(mw.config.get('wgPageName'))+"&action=submit&remove=1&id[]=";// ...or...// Unwatch links go to "Removed from watchlist" pagevarquery_prefix="action=unwatch&title=";// get list of all links in content:varlinks=document.getElementById('content').getElementsByTagName('a');// make a static copy of the nodelist and lose the original for speed// while we're at it, prune the uninteresting links from the listvarlinksCopy=newArray();for(vari=0;i<links.length;i++){if(/[?&]action=history([&#]|$)/.test(links[i].href))linksCopy.push(links[i]);}links=linksCopy;for(vari=0;i<links.length;i++){// create unwatch link and append it after history linkvarunwatch=document.createElement('a');unwatch.href=mw.config.get('wgServer')+mw.config.get('wgScriptPath')+"/index.php?"+query_prefix+encodeURIComponent(links[i].title);unwatch.title="Unwatch "+links[i].title;unwatch.appendChild(document.createTextNode("unwatch"));links[i].parentNode.insertBefore(unwatch,links[i].nextSibling);// insert a delimiter between the two linksvardelim=links[i].previousSibling;delimText=(delim.nodeType==3?delim.nodeValue:"");// kluge to handle case where "diff" is unlinkeddelim=document.createTextNode(delimText.replace(/^.*diff/,""));links[i].parentNode.insertBefore(delim,unwatch);}});