One of annoyances of using the web is that many webmasters (or at least their managers) think that forcing a browser to open a new window is a good idea. As I’ve said a number of times, creating a website that automatically opens a new window is almost always a Bad Idea. To eliminate this temptation, I have modified the text editor used on some of my sites so that users cannot create new windows using the HTML
target attribute from links on sites I visit.
Since I use the Safari and Chromium web browsers on OS X, my first impulse was to write a GlimmerBlocker script to remove the
target from links. This would fix the problem on all sites I visit with any browser. I had already written a GlimmerBlocker filter to remove
Before starting a new Extension, I searched for an existing one. It wasn’t on the official Extension list, but someone had already written one:
BlockTarget is an extension for Safari 5. It removes the ‘target’ attribute from links to prevent a new window being opened.
After skimming the source (how open a Safari Extension) for this Extension, I decided to give it a try. I’ve been using BlockTarget for two weeks, and it seems to work well. If you use Safari, this Extension will make the internet a more pleasant place.
target attribute to open new windows, they do it after BlockTarget has run, so it misses these
targets. I eventually need to find an efficient way to write a script to watch a page and remove all window opening code, but I won’t have time to work on that in the near future. So please, write a clean solution!