Created
September 10, 2011 01:07
-
-
Save makotom/1207767 to your computer and use it in GitHub Desktop.
UserJS to omit redirections in 2ch BBS.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
@tagawa
Good. I will employ your idea :)
I found out that String.indexOf is slightly faster than String.match. Interesting.
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
You should definitely make this into an extension!
Just a couple of things you could change if you like:
(not tested)