Open In Same Tab Bookmarklet

I've created a small bookmarklet that grabs all links in a page, and forces them to. um, open in a new window. Wait! Don't throw that tomato at me yet! Normally this would be absolute madness to unleash this upon the web, but iPhone in its infinite simplicity treats target="blank" as a trigger to open a new tab. Tiny annoyance solved!

Source (doctyper.com)


Download Bookmarklet:


View Bookmarklet Code:

Bookmarklet Source Code:

javascript%3A%28function%28%29%7Bvar%2520a%3Ddocument.getElementsByTagName%28%27a%27%29%3Bfor%28var%2520i%3D0%2Cj%3Da.length%3Bi%3Cj%3Bi++%29%7Ba%5Bi%5D.removeAttribute%28%27target%27%29%3Bvar%2520img%3Da%5Bi%5D.getElementsByTagName%28%27img%27%29%3Bfor%28var%2520k%3D0%2Cl%3Dimg.length%3Bk%3Cl%3Bk++%29%7Bif%2520%28img%5Bk%5D.getAttribute%28%27class%27%29%3D%3D%27new-window%27%29%7Bimg%5Bk%5D.parentNode.removeChild%28img%5Bk%5D%29%3B%7D%7D%7D%7D%29%28%29%3B


Rate it:


Tags:

Comments

Comments so far. Add yours.