Skip to content

Instantly share code, notes, and snippets.

@makotom
Created September 10, 2011 01:07
Show Gist options
  • Save makotom/1207767 to your computer and use it in GitHub Desktop.
Save makotom/1207767 to your computer and use it in GitHub Desktop.
UserJS to omit redirections in 2ch BBS.
addEventListener("DOMContentLoaded", function(){
if(location.hostname.indexOf(".2ch.net", location.hostname.length - ".2ch.net".length) === -1) return;
var a = document.getElementsByTagName("a"), i;
for(i = 0; i < a.length; i += 1) a[i].href = a[i].href.replace(/:\/\/ime\.nu\//, "://");
}, false);
@makotom
Copy link
Author

makotom commented Feb 2, 2012

@tagawa
Good. I will employ your idea :)

@makotom
Copy link
Author

makotom commented Feb 2, 2012

I found out that String.indexOf is slightly faster than String.match. Interesting.

@makotom
Copy link
Author

makotom commented Feb 2, 2012

Applied more updates to hostname matching, according to my speed test (http://tomato.myftp.org/blog/post?id=186).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment