In some pages, there are (still) links marked target="_blank"
.
Safari opens such link in a new tab.
How to have Safari open such link in the same tab ?
I have Safari 7 on Mavericks. I have older Safari as well.
Install the Safari extension LinkThing to customize links behavior. It should be able to solve your problem, additionally, you can also customize the onsite and offsite links behavior.
You can use a userscript such as the following:
var a = document.getElementsByTagName('a');
for (i=0;i<a.length;i++)
if (a[i].getAttribute('target')=='_blank')
a[i].setAttribute('target','_self');
I recommend installing using NinjaKit for Safari, but other userscript extensions also work.
@include
line (*
= all pages). You can install it using one of many 'Greasemonkey' extensions, and I recommend NinjaKit. Simply download and install the Safari extension, then click the install link in my answer. The script I've written above will get all a
links on the page, and if their attribute is _blank
it will change it to _self
.
@include
line or lines to one or more domains.
the backtick trick
` — to no avail.