Forbid links to open new tabs in Google Chrome
I'm looking for a solution to forbid links in Google Chrome to open new tabs (in most cases it is a target="_blank" issue).
So, I want all links to open pages in currently active tab, not in new tab.
I tried a wide range of addons (for ex. "Death to target=_blank") and greasemonkey scripts that are supposed to remove target=_blank attribute but none of them worked.
It is extremally anoying when I want to switch between accounts in GMail or navigate from GMail to GDrive. I always get the new tab opened and I need to close last tab manually.
You can use a pure Javascript method:
var links = document.querySelectorAll('a[target="_blank"]');
for (var i = 0; i < links.length; i++) links[i].target = '';
Or you can use jQuery:
$('a[target="_blank"]').each(function() {
this.target = '';
});
Then create an extension with it and install it to your browser. Chrome Developer Page