Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there any way, in any browser, with or without an extension, to override the target="_blank" behavior?

That I am aware of, there is no browser anywhere that will allow you to open a link with a target="_blank" attribute in the same window.

Is anyone aware of any way to override this attribute for end users?

share|improve this question

migrated from stackoverflow.com Aug 2 '12 at 20:46

This question came from our site for professional and enthusiast programmers.

add comment

5 Answers

up vote 2 down vote accepted

If the page has jquery you can inject the following:

$('a[target="_blank"]').removeAttr('target');
share|improve this answer
add comment

Firefox does allow you to override it:

Users who want to change this behavior need to type in about:config in a tab in the Firefox web browser. This should open the Firefox configuration. First time users need to accept a disclaimer. They then need to filter for the term browser.link.open_newwindow. The default value of that entry is 3 which opens links that would normally open in a new window in a new tab.

To force Firefox to open links (no matter if they have been designed to open in a new tab or window) in the same tab one would need to change the value to [1] which will open all links that would normally open in a new window in the same tab. Changing the value to [2] would open new windows in a new window (duh).

Value of 1: Opens links that would normally open in a new tab or new window in the current tab or window
Value of 2: Open links that would normally open in a new window, in a new window
Value of 3: Open links that would normally open in a new window in a new tab in the current window (default)

share|improve this answer
add comment

You can do this if your browser supports user scripts (such as Chrome or Firefox via a plugin).

Then you can write a user script to override the behaviour for the site/page you are interested in.

share|improve this answer
add comment

Greasemonkey has a number of user-generated scripts that will do this.

A few seconds of google turned up "Remove Link Target" -- there are lots of others.

share|improve this answer
add comment

Opera supports that in the pop up menu from right clicking on a link. It could be clearer, the choice is just labelled “Open”.

That is available in Opera 12 but it is one of the features missing from Opera 15.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.