Remove blank targets
Stops most links from opening to new windows.
Opera has long had a setting to more or less intelligently ignore the target attribute on elements so that new windows don't open on links while still allowing frames to function. Unfortunately this setting also disables the window.open() method, breaking the functionality of many sites.
This script aims to reduce the amount of new windows without interfering with frames, window.open() or named windows for panels. Rather than removing them outright as the script's name suggests, blank targets are changed to _top so that the intended destinations will break out of framesets when appropriate.
Tested with Opera version(s):
10.50



Comments
Thx!
Very useful script, thanks. :)
the better way
opera:config#UserPrefs|SingleWindowBrowsing
except it isn't
SingleWindowBrowsing isn't better as it disables an essential function for browsing in the process:
I actually wasn't aware of
I actually wasn't aware of that setting. I was thinking, rather, of opera:config#UserPrefs|IgnoreTarget, which prevents window.open() from functioning at all. SingleWindowBrowsing is indeed a good alternative, as it seems to play nice with panels and does allow window.open() to work, but if a page in question requires an action in an open()ed window to affect the host document, you're out of luck, because you can't middle-click to open it as a window. Still, it works for most cases, and I'm glad Mr. anonymous pointed it out, but I still prefer my script, since it errs on the side of caution.
Many thanks. Just what was
Many thanks. Just what was needed.
domestic empire
my opera blog