Jump to content

User:Quarl/hide own.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// User:Quarl/hide_own.js - change the "my watchlist" navigation button to default to hide own.

// based on http://en.wikipedia.org/wiki/Wikipedia:WikiProject_User_scripts/Scripts/hideOwn.js

// <pre><nowiki>

function hideOwn () {
  for (var i=0; i<document.links.length; ++i) {
    l = document.links[i];
    // note: text *is* capitalized in source, but rendered lowercase
    if (l.text == 'My watchlist' && l.href.indexOf('Special:Watchlist')>0) {
      l.href+='?hideOwn=1';
      break;
    }
  }
}

$(hideOwn);

// </nowiki></pre>