Created
September 21, 2010 11:42
-
-
Save 0mg/589554 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Twitter No XSS | |
| // @include http://twitter.com/* | |
| // @include https://twitter.com/* | |
| // ==/UserScript== | |
| ["load", "unload", "click", "dblclick", "mousedown", "mouseup", "mouseover", | |
| "mousemove", "mouseout", "focus", "blur", "keypress", "keydown", "keyup", | |
| "submit", "reset", "select", "change"]. | |
| forEach(function(s) { | |
| window.addEventListener(s, function(v) { | |
| if (v.target instanceof Element && | |
| v.target.parentNode.className === "entry-content") { | |
| v.stopPropagation(); | |
| } | |
| }, true); | |
| }); | |
| addEventListener("DOMContentLoaded", function(v) { | |
| var entryContent = document.evaluate('//span[@class="entry-content"]//a', | |
| document, null, 7, null); | |
| for (var i = 0; i < entryContent.snapshotLength; ++i) { | |
| var tweetUrl = entryContent.snapshotItem(i); | |
| var href = tweetUrl.href; | |
| while (tweetUrl.hasAttributes()) { | |
| tweetUrl.removeAttribute(tweetUrl.attributes[0].nodeName); | |
| } | |
| tweetUrl.href = href; | |
| } | |
| }, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What exactly does this script do?