Advertisement
xenoside

enha to namu

May 29th, 2015
1,230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         enha to namu
  3. // @namespace    http://xenosi.de/
  4. // @version      0.2
  5. // @description  fixit
  6. // @author       Song Hyo Jin (shj at xenosi.de)
  7. // @match        https://www.google.com/*
  8. // @match        https://www.google.co.kr/*
  9. // @match        http://www.google.com/*
  10. // @match        http://www.google.co.kr/*
  11. // @grant        none
  12. // ==/UserScript==
  13.  
  14. setInterval(function() {
  15.     var as = document.querySelectorAll('a:not(.replaced)');
  16.     if(!as.length) return;
  17.     for(var i = 0; i < as.length; i ++) {
  18.         (function(a) {
  19.             a.className += ' replaced';
  20.             var href = a.href.replace(/mirror\.enha\.kr\/wiki/g, 'namu.wiki/w');
  21.             if(href != a.href) {
  22.                 a.href = href;
  23.                 a.removeAttribute('onmousedown');
  24.                 var b = a.cloneNode(true);
  25.                 a.parentNode.replaceChild(b, a);
  26.             }
  27.         })(as[i]);
  28.     }
  29. }, 500);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement