Preventing Sites From Opening New Tabs/Windows

by Ian Dunn

UPDATE: There’s now a Chrome extension called TheOne which does this, so you don’t need to create your own user script.

I wrote earlier about why it’s wrong for websites to force links to open in a new tab or window, but it’ll probably be at least a few years before the majority of clients and web developers finally come around. In the mean time it’d be nice for users to have a way to prevent their browsers from implementing the practice, but surprisingly there aren’t any Chrome extensions. You can create and install a user script, though.

Here’s my modified version of the script:

// ==UserScript==
// @name Open Links in Same Tab/Window
// @description Prevents websites from forcing links to open in new tabs or windows.
// @version 0.1
// ==/UserScript==

2 Comments

This is brilliant and I’m blogging about it in my series on web browsers. Unfortunately, Greasemonkey reports that it is lacking @grant privileges and won’t run. Could you please update the script. It is invaluable. Thanks.