Created
January 13, 2010 00:48
-
-
Save 10sr/275800 to your computer and use it in GitHub Desktop.
すべてのリンクを新しいタブで開くぐりもん
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
// ==UserScript== | |
// @name open all in new tab | |
// @namespace 10sr.posterous.com | |
// @discription add target="_blank" to all anchors | |
// @include http://* | |
// @include https://* | |
// @exclude http://delicious.com/* | |
// @exclude https://secure.delicious.com/* | |
// @exclude http://twitter.com/* | |
// @exclude https://twitter.com* | |
// @exclude http://gist.github.com/* | |
// @exclude https://gist.github.com/* | |
// @exclude http://github.com/* | |
// @exclude https://github.com/* | |
// @exclude http://jottit.com/* | |
// @exclude http://posterous.com/manage/* | |
// @exclude http://piconote.com/* | |
// @exclude http://ping.fm/* | |
// @exclude http://www29.atwiki.jp/10sr* | |
// @exclude http://identi.ca/ | |
// @include http://twitter.com/ | |
// @include https://twitter.com/ | |
// ==/UserScript== | |
// | |
// http://moto-mono.net/2009/09/03/ofbnw.htmlを書き換え。 | |
// | |
// | |
new function(){ | |
var urlw = /^[^(javascript)]/i; | |
function OpenFileByNewWin(){ | |
var a = document.getElementsByTagName('a'); | |
for(var i=0;i<a.length;i++){ | |
if(a[i].href.match(urlw)){ | |
if(a[i].target || a[i].target!='_blank'){ | |
a[i].target = '_blank'; | |
} | |
} | |
} | |
} | |
window.addEventListener('load',OpenFileByNewWin,false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment