Huntereb

Replace is/is2 with i.4cdn.org on 4chan

Feb 4th, 2017
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        Replace is/is2 with i.4cdn.org
  3. // @namespace   boards.4chan.org
  4. // @include     *boards.4chan.org*
  5. // @description Replaces slow new links with fast old ones
  6. // @version     1
  7. // @grant       none
  8. // ==/UserScript==
  9.  
  10. function replaceLinks () {
  11.   var aTags = document.getElementsByTagName('a');
  12.  
  13.   for (i = 0; i < aTags.length; i++) {
  14.       if (aTags[i].href.includes('is2.4chan.org')) aTags[i].href = aTags[i].href.replace('is2.4chan.org', 'i.4cdn.org');
  15.       if (aTags[i].href.includes('is.4chan.org')) aTags[i].href = aTags[i].href.replace('is.4chan.org', 'i.4cdn.org');
  16.   }
  17.   setTimeout(replaceLinks, 500);
  18. }
  19.  
  20. replaceLinks();
Add Comment
Please, Sign In to add comment