Created
July 19, 2011 05:31
-
-
Save namusyaka/1091385 to your computer and use it in GitHub Desktop.
外部リンク自動検出のやつ source:rskull
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
javascript:function AutoCheckURL() { | |
var HostURL = new RegExp(location.hostname + "(\\:[0-9]+)?"), | |
CheckURL = document.links; | |
for(var i = 0; i < CheckURL.length; ++i) | |
if(!HostURL.test(CheckURL[i].href.split('/')[2])) | |
CheckURL[i].target = '_blank'; | |
} | |
AutoCheckURL(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment