ghacks Technology News

Force Firefox To Open Links In Same Tab

firefoxOne of the great annoyances on the Internet are links that are configured to open in new links or tabs. Outbound links, which means links that point to another domain, are usually prime targets for this method of linking but there are also cases that links on the same domain open up in new tabs or windows. The Firefox web browser comes with a set of options to open links in new tabs or windows but no obvious ones to prevent that from happening.

To open a link in a new window or tab one would simply right-click the link and select the appropriate option from the context menu. Users who like keyboard shortcuts can press the Ctrl key for opening links in new tabs or the Shift key to open them in new windows.

Thankfully though there is a parameter in the Firefox configuration that allows Firefox users to force the web browser to open links in the same tab unless one of the previously mentioned ways of opening links in new tabs or windows is selected.

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.

browser link open new window

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).

Update:

Just noticed that changing the value to 1 does affect links that are opened in external applications as well. These links will now open in the active tab and not a new tab.

Enjoyed the article?: Then sign-up for our free newsletter or RSS feed to kick off your day with the latest technology news and tips, or share the article with your friends and contacts on Facebook or Twitter.

Related Articles:

Open multiple links at once in Firefox
How To Open Links In Firefox In New Tabs, Windows
Open Multiple Links At Once In Firefox
Selection Links, Open, Download Multiple Firefox Link Targets
Open Links in Private Browsing Mode In Firefox



About the Author:Martin Brinkmann is a journalist from Germany who founded Ghacks Technology News Back in 2005. He is passionate about all things tech and knows the Internet and computers like the back of his hand. You can follow Martin on Facebook or Twitter.

Author: , Friday July 3, 2009 -
Tags:, , , ,


Responses so far:

  1. paulus says:

    Yeah (duh) really nice Martin but what about links who are opening in the same tab? I really want all links the open in a new tab.

  2. Phaoloo says:

    Nice hack :D

  3. paulus says:

    With the worth of a thousand in mind this days i have to wright to you, thanks a mil. for your quick and very handy advice to me.

  4. Nosh says:

    Nice tip, Martin. Thx!

  5. wako says:

    You forgot to explain that you have the “restriction” entry to [0] to get rid of pop-ups :D
    Thanks for the tip

  6. hwsris says:

    Thank Martin , it work fine in v.15 too.

  7. Jojo says:

    I agree with Paules. I want ANY link I click on to open in a new tab and I don’t want to hold down the Ctrl key to do so..

    The settings you refer to in About:Config are both set to 3 in my system, so that SHOULD make everything open in a new tab, but it doesn’t.

    For instance, from Google Reader, SOME entries will open directly in a new tab, while others will only open in new window, unless I right click and select open in a new tab. I’m curious as to what causes this to happen.

    • Martin says:

      JoJo have you set the Always open new windows in tabs option in the Firefox options? I’m also curious how you handle navigating on the same site if all links open in a new tab, that seems mighty uncomfortable.

  8. Jojo says:

    @Martin

    Yes, the option to always open in a new tab is set. Clearly it doesn’t work. Maybe TabMix Plus interferes?

    I’m not sure how to answer your question about navigation. Opening in a new tab seems most logical to me. If I want to open multiple links on a page (like when I am in a threaded forum), I will open a new window and then drag links into that window. That way I still maintain the original root. Maybe this works for me because I commonly keep a lot of tabs open and get back to them over time (I have 72 tabs open right now).

  9. These settings doesn’t seem to work for me :(. I am using Firefox 3.0.12. I want to open all Internal links in same tab i.e. if a local url is already open in a tab, just switch me over to that tab and refresh that page. This is useful when I am developing some web application and running it from Eclipse IDE. Is it really complex to achieve it in firefox, I guess Safari in Mac do it well
    .

  10. Ray says:

    Get Tab Mix Plus and go to the Links tab. Select the drop down option for Javascript pop-ups: Open all pop-ups in tabs.

  11. Ray says:

    Get Tab Mix Plus and go to the links menu. Select the dropdown option for Javascript pop-ups: Open all pop-ups in tabs.

  12. alumley says:

    A big thank you for this tip which works perfectly.

  13. matt says:

    thankyou man. you are a light of glory shinning through the internets darkness.

  14. thank you for the post.

  15. sam says:

    oh man, thank you so much

  16. muzikween says:

    I cannot get links to open in tabs with any settings. Have Tools/Options set to open all links in a new tab, but that doesn’t work. Have set config to 3 and that does not work either. Everything always opens in the same tab. I can manually open but right clicking the link and telling it to open in new tab, but what a pain. This was not like this yesterday or day before and I have not changed any settings. Has to be a FF issue! If anyone finds out what’s going on, please post. Thanks!

    • Try middle-clicking links.

    • dmac says:

      muzikween
      It seems we are opposites – you don’t want links opening in the same tab but I do, If you find out why yours works the way it does I’d appreciate that info as it sounds like the situation I want to achieve. If I find out why mine seems to be misbehaving I’ll post again!!!

  17. App-o-holic says:

    Thank you:)

  18. dmac says:

    I can’t get this to work with FF5. I would like links to just open in the tab i’m using. If I need to see a page again then I’ll just use the history functions. Ideally I would like to have just one tab open for my whole session UNLESS I physically choose to open a particular link in a new tab or window. FF5 isn’t making this easy to achieve. Any assistance appreciated.

  19. Schalk says:

    Rockstar you are. This worked great. Many thanks

  20. Kate says:

    I use a tab groups and a sidebar that has parent and child tabs, and it would be nice if I could specify this behavior for only certain parents/children. I’d apply it to a couple of parent/child sets in the Group I use for work, but I’d want the default behavior to happen in the rest of my tabs.

  21. Thanks a ton!!

    Now that they have stopped development of prism, I have decided to try and use the ‘app tabs’ introduced in Firefox 8. Many of my apps run on several domains, and Firefox likes to open the links in new windows by default, defeating the purpose of having a tab pinned.

    This did the trick for me, now my apps will stay inside their pinned windows. Thanks!

Leave a Reply   Follow Ghacks   Subscribe To Comment Rss

Subscribe without commenting

© 2005-2012 Ghacks.net. All Rights Reserved. Privacy Policy - About Us