Created
July 11, 2012 08:09
-
-
Save takada-at/3088872 to your computer and use it in GitHub Desktop.
prevent twitter's popup
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 prevent twitter popup | |
// @author at_akada | |
// @namespace http://d.hatena.ne.jp/at_akada/ | |
// @include https://twitter.com/* | |
// ==/UserScript== | |
function bind(arg, f){ | |
return function(){ | |
return f(arg, arguments); | |
}; | |
} | |
function main(){ | |
var list = document.body.getElementsByTagName('a'); | |
for(var i=0; i<list.length;++i){ | |
if(list[i].className.indexOf('js-action-profile') >= 0 || list[i].className.indexOf('twitter-atreply') >= 0){ | |
list[i].className = ''; | |
list[i].addEventListener('click', | |
bind(list[i], function(link, args){ | |
document.location = link.href; | |
args[0].stopPropagation(); | |
args[0].preventDefault(); | |
})); | |
} | |
} | |
} | |
setInterval(main, 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment