Reddit: Remove 'np'

Changes np links to regular links

  1. // ==UserScript==
  2. // @name Reddit: Remove 'np'
  3. // @namespace greasyfork.org/en/users/9965
  4. // @description Changes np links to regular links
  5. // @version 1.0
  6. // @match http://www.reddit.com/*
  7. // @match https://www.reddit.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. document.addEventListener("DOMContentLoaded", fixLinks, false);
  12.  
  13. if( document.readyState === "complete" ) {
  14. fixLinks();
  15. }
  16.  
  17. function fixLinks() {
  18. Array.forEach( document.links, function(a) {
  19. a.href = a.href.replace(/np\.reddit/i, "www.reddit");
  20. });
  21. }
  22.  
  23.