Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose I have a site with this code:

<!DOCTYPE html>
    <a href="">1</a><br>
    <a href="" target="_blank">2</a><br>
    <a href="" onclick=";return false;">3</a><br>

but I do not want to open any new tabs or windows. I know I can drag the link into the address bar to force open the link in the current tab instead of a new one, but it is too cumbersome.

Is there a more convenient way to do it, like keyboard shortcut or maybe an extension?

share|improve this question
up vote 2 down vote accepted

Install LinkThing by Canibos. This Safari extension lets you configure how the browser handle the links. You can then choose to open all the onsite and offsite links in current tabs.

share|improve this answer

As far as I know, there's no way to force a link to open in the current tab when it has target="_blank". There's controversy over this attribute in the web development world because it's considered overbearing to force a user to open a link in a new tab when they don't want to.

Essentially, the browser is seen as the user's property, and they have the right to decide where they want links to open. This link property has been abused many times for popup ads and, while it can be useful, it generally creates a bad user experience.

I assume the only way around it would be to create (or find?) an extension that goes through all of the links on a page and removes the target attribute. It appears that @sayzlim has found one for you (see here).

As for your third example, there's no way around that other than to disable JavaScript in your browser.

share|improve this answer
The third example can be overridden, if LinkThing developer add something like this to his code: f=function(url) {document.location.href=url;};; – Sergei Jun 15 '14 at 16:09
@Sergei True, but you can override it directly: = function(url){ window.location.href = url;}; – AstroCB Jun 15 '14 at 16:13

Your Answer


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.