How to make Firefox open new tabs next to the current tab

Martin Brinkmann
Updated •
Firefox

To make Firefox open new tabs next to the current tab, open about:config, search for browser.tabs.insertAfterCurrent and set it to true. New blank tabs (Ctrl+T or the plus button) and tabs opened from bookmarks or history then appear directly to the right of the active tab instead of at the end of the tab bar. No add-on is needed, and the change is easy to undo.

This guide covers the about:config method, the related preference for links, how to get the opposite behavior (every new tab at the end), and the add-on alternative.

How Firefox decides where a new tab opens

Firefox places a new tab based on two about:config preferences, and only one of them is enabled by default. The default file that ships with Firefox describes them like this:

  • browser.tabs.insertAfterCurrent (default false): when true, Firefox opens all new tabs, including bookmarks and history items, next to the current tab. When false, non-related tabs are appended to the end of the tab bar.
  • browser.tabs.insertRelatedAfterCurrent (default true): tabs opened from a link in the current tab open next to it, and consecutive related tabs are chained behind their opener. When false, related tabs are positioned like any other new tab.

That explains the behavior most people notice: middle-click a link and the tab lands right beside the page you were reading, but press Ctrl+T and the blank tab jumps to the far end of a long tab bar. With 30 or 50 tabs open, the new tab and the tab you came from end up far apart.

This split dates back to Firefox 3.6 in 2010. Before that release, every new tab opened at the end of the tab bar. Since 3.6, tabs opened from links sit next to their opener, while unrelated tabs such as Ctrl+T go to the end.

The tab settings in Firefox's Settings page do not offer a general "open new tabs next to the current tab" switch. The closest option, "Open links from apps next to your active tab", only affects links opened from other applications. For everything else, about:config is the built-in way.

Open new tabs next to the current tab in Firefox (about:config)

Setting browser.tabs.insertAfterCurrent to true makes Firefox open new tabs next to the current tab. Follow these steps:

Firefox about:config showing the browser.tabs.insertAfterCurrent preference

  1. Type about:config in the Firefox address bar and press Enter.
  2. If a warning page appears, click Accept the Risk and Continue.
  3. Type browser.tabs.insertAfterCurrent in the Search preference name box.
  4. Double-click the preference, or click its Toggle button, so the value reads true.
  5. Press Ctrl+T to check the result. If new tabs still open at the end, restart Firefox.

Preference names are case-sensitive, so copy the name exactly. A modified preference is shown in bold, and the Reset button next to it restores the default value of false. The setting is stored in your Firefox profile, so each profile you use (see how Firefox profiles work) needs the change separately.

Make Firefox open new tabs at the end instead

Firefox already opens blank new tabs at the end of the tab bar by default, so you only need to change something if you want links to behave the same way. To send every new tab to the end:

  1. Open about:config and accept the warning if it appears.
  2. Make sure browser.tabs.insertAfterCurrent is set to false (the default).
  3. Search for browser.tabs.insertRelatedAfterCurrent and set it to false.

Now tabs opened from links, bookmarks and history are all appended to the end, in the order you open them. This suits people who read tabs left to right like a queue. If you changed browser.tabs.insertAfterCurrent earlier and want the stock behavior back, click Reset on both preferences.

Which combination of preferences should you use?

The two preferences give you three useful setups. Pick the one that matches how you work:

Goal insertAfterCurrent insertRelatedAfterCurrent
Firefox default: links next to the current tab, blank tabs at the end false true
All new tabs next to the current tab true true
All new tabs at the end of the tab bar false false

Keeping new tabs next to the active one works well with heavy tab use, because research tabs stay grouped by context. If you want stronger grouping, combine it with Firefox tab groups, which let you collect related tabs under a name.

Always Right: the add-on alternative

Always Right is a Firefox add-on that places new tabs directly to the right of the current tab rather than at the end of the tab strip. It works automatically after installation and does not need any configuration.

Always Right add-on for Firefox that opens new tabs to the right of the active tab

The add-on is still listed on Firefox Add-ons, links to its source code on GitHub, and asks for permission to read and modify browser settings and access browser tabs. Its last update on the listing dates from April 2024.

For most users, the about:config preference is the better choice: it is built into Firefox, needs no extra permissions and keeps working without an add-on that could be abandoned. The add-on mainly helps if you cannot or do not want to edit about:config, for example on a shared profile where you prefer an on and off switch in the add-ons manager.

FAQ

Does browser.tabs.insertAfterCurrent change where middle-clicked links open?

No. Links opened from the current page are governed by browser.tabs.insertRelatedAfterCurrent, which already places them next to the current tab by default.

Can I return to the tab that opened a tab when I close it?

Usually, for tabs opened from links. The preference browser.tabs.selectOwnerOnClose is true by default, so closing such a tab returns you to the tab that opened it, as long as you have not switched to another tab in between.

Is it safe to change these about:config preferences?

Yes. Both are standard Firefox preferences that only affect tab placement, and the Reset button restores the default value at any time.

Related: save and restore Firefox tabs with Session Boss, search across all open Firefox tabs, free memory with Auto Tab Discard

Comments

  1. Zsolt said on
    Reply

    What about Android FF? Nothing seems to work for it…

  2. Anonymous said on
    Reply

    When opening a group of bookmarks in tabs with any of these workarounds, the order is reversed. First goes to far right, last goes to next right. Is there a way to fix this?

  3. foromir said on
    Reply

    “There is no option to jump back to the previously active tab in Firefox”
    Yes, there is such an action. Ctrl+TAB. I may have set some preference to get it but I’m sure it’s not by an addon. I’m on windows 7, FF 59.x

  4. beemeup5 said on
    Reply

    Meanwhile, Tab Mix Plus veterans have had this since forever.

    1. TelV said on
      Reply

      Tab Mix Plus is a legacy extension and won’t work in FF57+

      1. q. said on
        Reply

        TabMix Plus is (was) such a fundamentally productive and useful set of features and processes that it should be built into FireFox (and for that matter, all browsers) from the ground up. That it is not, is an indication of just how lost and dysfunctional the design process at Mozilla has become since embarking on the mission to completely redefine the experienced-user driven FireFox mission. That was what made FireFox a leader, and what is now leading to its eventual demise.

      2. q. said on
        Reply

        TabMix Plus is (was) such a fundamentally productive and useful set of features and processes that it should be built into FireFox (and for that matter, all browsers) from the ground up. That it is not, is an indication of just how lost and dysfunctional the design process at Mozilla has become since embarking on the mission to completely redefine the experienced-user driven FireFox mission. That was what made FireFox a leader and what is now leading to its eventual demise.

      3. beemeup5 said on
        Reply

        Adding back a feature that was long available before is textbook evidence of regression.

  5. sbd said on
    Reply

    browser.tabs.insertRelatedAfterCurrent set to false does not work on some sites, such as lifehacker, politico, 3quarksdaily

    1. sbd said on
      Reply

      Sorry. Correction: an add-on was causing this.

  6. Difool2nice said on
    Reply

    the only pref in about:config i can see about is

    browser.tabs.insertRelatedAfterCurrent

    and set it to true/false

  7. Robin217 said on
    Reply

    But, good UI requires that the “+” icon should still open new tabs at the end, next to the “+” icon you just clicked!

    This combination of Add-ons gives me the desired behavior:

    https://addons.mozilla.org/en-US/firefox/addon/new-tab-beside/
    https://addons.mozilla.org/en-US/firefox/addon/tab-open-close-control/
    https://addons.mozilla.org/en-US/firefox/addon/new-tab-homepage/

    Ctrl+TAB still opens new tabs at the end.
    Clicking the “+” icon still opens new tabs next to the “+” icon.
    Ctrl+Shift+1 opens new tab next to current tab

    1. Robin217 said on
      Reply

      Correction: I meant “T” instead of “TAB”:

      “Ctrl+T still opens new tabs at the end.”

  8. killmozilla said on
    Reply

    You can memorize your current tab’s title, then use some of its words with the ‘%’ character, without the quotes, a list with open tabs having those words will appear.

    Opening to the right breaks the opening order. 1 2 3 4 5 becomes 5 4 3 2 1

    You can also use the plus icon + , but with the middle mouse button to open a new tab to the right

  9. TelV said on
    Reply

    Why do my posts keep disappearing on this forum??????

    1. Martin Brinkmann said on
      Reply

      Which posts are missing?

      1. TelV said on
        Reply

        @ Martin,

        Those that I thought had disappeared appear to be visible once again. Don’t ask me why.

        But I’ve noticed that when I’ve tried to post the same content again because it didn’t appear anywhere, a warning appeared to say that I’d already posted it even though it was nowhere to be found. I know you check posts that contain links, but on several occasions the content didn’t contain any.

        I’m also seeing a warning that I’m trying to post too quickly. I just saw it again just now even though this is my first post today!

      2. Martin Brinkmann said on
        Reply

        I see. This seems to be a recurring issue but it is difficult to pinpoint it. Do you use a VPN by chance or shared Internet connection?

      3. TelV said on
        Reply

        Mullvad VPN. The only problem I’ve ever encountered elsewhere was an abysmal download rate on the Microsoft Catalog site whereby a 221MB file was expected to take 1hr 20 mins to download. After disabling the VPN the file downloaded in seconds.

        By the way, I notice that all the Reply buttons are missing on all the posts in the following thread and there’s no Comment box at the foot of it: https://www.ghacks.net/2018/04/29/re-based-basilisk-browser-released/

      4. Martin Brinkmann said on
        Reply

        I disabled comments on that thread because it went out of hand.

  10. mo.eu said on
    Reply

    “There is no option to jump back to the previously active tab in Firefox”

    A single + will bring me back to the previous tab in Firefox.

    1. mo.eu said on
      Reply

      Sorry, that should be:

      A single CTRL+TAB will bring me back to the previous tab in Firefox

      (something ate the less-than and greater-than characters that I had used and the text in between)

  11. Richard Allen said on
    Reply

    Right now, for me, in both FFv60 and in Nightly, every link either opens next to the current tab or in the same tab. CTRL+left-click, middle-click, and right-click – “Open in New Tab” will all open a link next to the current tab, including links to different sites. What am I missing? The about:config setting of “browser.tabs.insertRelatedAfterCurrent” if set to the default of ‘true’ does the above for me.

    The only way I can get a link to open a tab at the end of the tab bar is to copy/paste a link into the address bar and open it from there. But, if the setting of “browser.tabs.insertAfterCurrent” is set to true in Nightly then links opened from the address bar will open next to the current tab. For me “insertAfterCurrent” has to be added and even then will not work in FFv60 but… the addon works in FFv60 and will open a link from the address bar next to the current tab.

    1. Cigologic said on
      Reply

      @ Richard Allen — I think there’s a misunderstanding of the article.

      1) Existing pref in Firefox v60 & older:
      → browser.tabs.insertRelatedAfterCurrent

      ☻ True (default): Always open hyperlinks in new tab on immediate right side of current tab
      ☻ False: Always open hyperlinks in new tab at end of all open tabs

      Note: The above pref (whether set to true or false) has no effect on the behaviour of ‘Menu: File > Open New Tab’ (CTRL-T), which essentially opens a new BLANK tab. New blank tabs are always opened at the end of all open tabs.

      If you want new blank tabs to be opened on immediate right side of the current tab, you need to install an addon (eg. Always Right).

      2) Additional pref introduced in Firefox Beta/Dev/Nightly v61:
      → browser.tabs.insertAfterCurrent

      ☻ True: Always open new blank tabs on immediate right side of current tab
      ☻ False (default): Always open new blank tabs at end of all open tabs (ie. same behaviour as in Firefox v60 & older)

      If the above pref is set to true, there is no longer any need to install an addon just to open a new blank tab on the immediate right side of the current tab.

      1. Richard Allen said on
        Reply

        @Cigologic — Thank You!

        What I was missing is that me, myself, and I were all thinking “links” and Martin was talking about “new tab” pages. D’oh!

        If you open a new tab with CTRL+T or… you open a link from the address bar and want it opened next to the current tab, you need to use an addon in FFv60 or… in FFv61+ you can instead use “browser.tabs.insertAfterCurrent” set to true. I know all that, I just wasn’t at all thinking about new tab pages, I rarely ever use them. I just use CTRL+L to find bookmarks, history entries, and to do the occasional web search. Most of my web searches are done by highlighting a word or group of words in a webpage and then using the right-click context menu to pick from 20 different search engines. Don’t need no stinking new tab page!

        Anyway, I like the bullet you’re using and I think they look even better on the dark theme I use on gHacks. Actually took me a minute to notice what they were. Just a little vision challenged. Peace! ;)
        “https://s14.postimg.cc/fe8dx4dwx/New_bullets.png”

  12. Anonymous said on
    Reply

    Still mess. Opening by middle click still opens in A123B order, and moment of distraction (switch tab and go back) and you will have A456123B.

  13. michlind said on
    Reply

    The filter should be “browser.tabs.insertRelatedAfterCurrent” NOT (browser.tabs.insertAfterCurrent”.

    1. sbd said on
      Reply

      Thanks, michlind

  14. sbd said on
    Reply

    On Nightly 62.0a1, browser.tabs.insertAfterCurrent is “false” by default, but “after current” is still in effect.

  15. Chuck Reul said on
    Reply

    Same problem for me with Firefox 60. The preference does not exist.

  16. Hum1 said on
    Reply

    And if you occasionally want to open a new tab next to the current one, just middle-click new tab button (plus icon on tab bar) and there it goes.

  17. Tom Hawack said on
    Reply

    Quoting the article,
    “There is no option to jump back to the previously active tab in Firefox”

    Indeed and with many opened tabs that is problematic (even sometimes with several).

    There’s a neat Firefox extension which allows to “jump back to the previously active tab” and it’s called ‘Switch To Previous Active Tab’ [https://addons.mozilla.org/en-US/firefox/addon/switch-to-previous-active-tab/]

    I use this ‘Switch To Previous Active Tab’, not because I surf with dozens of opened tabs but rather because I prefer to have new tabs open at the end and not next to the active tab. Really handy, and also when just comparing two tabs among several, like tab 4-9-4-9 etc…

  18. TelV said on
    Reply

    The addon doesn’t work for me (using Waterfox). However, after creating the config-pref (it doesn’t exist by default) new tabs now open immediately to the right of the current one. Thanks for the tip Martin.

    For the benefit of anyone else using Waterfox:

    Open about:config and then copy/paste “browser.tabs.insertAfterCurrent” (without quotes) in the filter at the top which results in a blank page.

    Right click anywhere in the blank area and choose New —> boolean and copy/paste browser.tabs.insertAfterCurrent. In the settings dialog box which appears, set it to True.

  19. jimbo said on
    Reply

    should be … insertRelatedAfterCurrent

    1. sbd said on
      Reply

      Thanks also, jimbo

  20. Paul(us) said on
    Reply

    On the all fashioned way by tweaking the settings. And even now there is an add-on I will stay with the tweaking way. This because I try to minimize the number of add-ons installed because before I noticed that how more add-ons one has installed, not only more can go wrong but also the browser became less responsive.

    And Martin i have tried to open your string about:config?filter=browser.tabs.insertAfterCurrent
    at once in the Firefox 60 but it only brought me step 2.
    There was no list where to define the preference?

    So I am keeping this method:
    1.) In the address bar, type about:config and press the Enter key.
    2.) The about:config “This might void your warranty!” warning page may appear.
    Click I accept the risk! to continue to the about:config page.
    3.) In the search box at the top, type “browser.tabs.insertRelatedAfterCurrent”.
    4.) Double-click on the first item that appears in the list to change the value to false.

  21. Nico said on
    Reply

    I can’t find it in Version 60 either, only browser.tabs.insertRelatedAfterCurrent (true).
    It does exist in nightly (61) however.

    1. Tom Hawack said on
      Reply

      I had forgotten that one, indeed:

      // 8023: control tab behaviours (with defaults) — open links in a new tab immediately to (NEXT TO) the right of parent tab, not far right
      user_pref(“browser.tabs.insertRelatedAfterCurrent”, false); // Default = true

      Also, since we’re at it :

      // 2203: open links targeting new windows in a new tab instead
      user_pref(“browser.link.open_newwindow”, 3); // Default = 3
      user_pref(“browser.link.open_newwindow.restriction”, 0); // Default = 2

      // 8024: switch to the parent tab (if it has one) on close, rather than to the adjacent right tab if it exists or to the adjacent left tab if it doesn’t.
      // [NOTE] Requires browser.link.open_newwindow set to 3
      user_pref(“browser.tabs.selectOwnerOnClose”, true);

      // 8025: stay on the parent tab when opening links in a new tab
      user_pref(“browser.tabs.loadInBackground”, false);

      I guess they’re all there, now!

  22. Test#862 said on
    Reply

    I’ve been testing Firefox 60 for two days now and i’ve come to the sad conclusion that mozilla is fighting a losing war not just battle.

    RIP Firefox

    1. teranklense said on
      Reply

      which battle which war

      will always be better than that closed source bs from google

  23. Yuliya said on
    Reply

    I’d like this. Which version of FireFox? On 60 I don’t have this preference “browser.tabs.insertAfterCurrent”. I tried creating it, set to true, restart, but nothing. New tabs still open at the end.

    1. ULBoom said on
      Reply

      It’s in 59 as browser.tabs.insertRelatedAfterCurrent.

      I turned off updates. Really hope FF doesn’t junk up itself like Windows has. Really hope all these Windows and FF blunders are another set of temporary low points.

    2. srs said on
      Reply

      That browser preference is only with version 61. https://bugzilla.mozilla.org/show_bug.cgi?id=1344749

      One preference that did make it to 60 is always open a new tab from the address bar: browser.urlbar.openintab (https://bugzilla.mozilla.org/show_bug.cgi?id=1394304)

    3. Arne Anka said on
      Reply

      On the addons-page it says something about using a new pref:
      browser.browserSettings.newTabPosition
      Can’t try myself, I’m on the ESR…

    4. Rick A. said on
      Reply

      @Yuliya – Same, i don’t have this preference, Firefox 60.

    5. Agent Smith said on
      Reply

      I use Firefox Developer Edition 61.0b3 (64-bit) and I have that setting.

    6. Peter said on
      Reply

      Same here.

    7. Tom Hawack said on
      Reply

      Same here (FF60) : no browser.tabs.insertAfterCurrent in the about:config, unless it is a hidden setting (of which I’ve never heard of).

      Concerning tabs’ opening all I’m aware of on Firefox (valid for FF60) is (Source: Pants’ Ghacks-user.js),

      // 8007: disable closing browser with last tab
      user_pref(“browser.tabs.closeWindowWithLastTab”, false);

      // 8011: open bookmarks in a new tab (FF57+) — [NOTE] You can also use middle-click, cmd/ctl-click, and use the context menu
      user_pref(“browser.tabs.loadBookmarksInTabs”, true); // Default = false | true => open bookmarked links in new tab

      // 8012: open bookmarks (when in new tab) in foreground
      user_pref(“browser.tabs.loadBookmarksInBackground”, false); // Default = false | true = open bookmarked links in background tab

      // 8013: open search results in a new tab
      user_pref(“browser.search.openintab”, true); // Default = false — open search queries in new tab

      So, for those who wish the new tab to appear next to the active one, the extension detailed by this article is of course pertinent.

    8. Ban me said on
      Reply

      It’s said in the article: “Always Right is an open source add-on for the Firefox web browser that changes Firefox’s default new tab opening behavior.”

Leave a Reply

By commenting, you accept our privacy policy and keep the discussion respectful and on topic.