Configure what Firefox does when you close a tab - gHacks Tech News

Configure what Firefox does when you close a tab

What happens when you close a tab in the Firefox web browser? If only one tab is open, Firefox will close. If multiple tabs are open, Firefox will open the last activate tab in the browser provided there was one.

If there was none, Firefox will load the tab to the left of the closed tab or the tab to the right depending on the closed tabs position in the tab bar of the browser.

While you can prevent Firefox from closing windows when the last tab is closed, by setting browser.tabs.closeWindowWithLastTab to false on about:config, it is not possible to change the order which Firefox consults to decide which tab to activate when a tab is closed.

Tip: find out how to restore closed tabs faster in Firefox.

Select After Closing Current

configure firefox tab open after close

Select After Closing Current is a Firefox extension that gives users full control of the order when a new tab needs to be activated because the current one is closed.

The extension displays Firefox's default order in the interface after installation; means, nothing changes right after installation. You need to open the extension's settings, by loading about:addons and clicking on options next to Select After Closing Current, to change the order.

You can add and remove entries from the list of actions. The extension checks each starting with the one at the top and selects the first that matches the situation.

This looks like the following for the default configuration:

  1. If there is a last accessed tab, select it.
  2. If there is none, select the tab to the left of the closed one.
  3. If there is none, select the tab to the right of the closed one.

The extension supports the following options:

  • Position: first, last, left, or right.
  • Relation: tab, last accessed tab, parent tab, sibling tab, child tab, unread tab, unread child tab.

You combine position with relation to create new rules. Some examples:

  • open the first unread tab.
  • open the first unread sibling tab.
  • open the first unread tab to the right.
  • open the last child tab.

Use the up and down arrow buttons to move a rule and change the order of all rules in the process.

Select After Closing Current supports five keyboard shortcuts that you can configure. Select a key on the keyboard and modifiers, and assign each shortcut to a particular rule. Each shortcut closes the current tab and activates the assigned rule afterward.

Closing Words and verdict

Select After Closing Current is a useful extension for the Firefox web browser to change processing rules when a tab is closed in the Firefox web browser. The option to assign shortcuts to specific rules is handy as well as it ensures that the particular rule is executed provided that it is possible.

Summary
software image
Author Rating
1star1star1star1star1star
5 based on 1 votes
Software Name
Select After Closing Current
Software Category
Browser
Landing Page
Advertisement

We need your help

Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.

If you like our content, and would like to help, please consider making a contribution:


Previous Post: «
Next Post: »

Comments

  1. flash said on September 12, 2018 at 5:23 pm
    Reply

    Thanks for this post. I had thus far been using the extension “Tab Open/Close Control” by F. Kolbe (https://addons.mozilla.org/en-US/firefox/addon/tab-open-close-control/) but after testing this one you advertised it seems to work better, more reliably and has extra setting options. Awesome.

    1. gwacks said on September 13, 2018 at 8:25 am
      Reply

      I’d like to share my very rules with you guys. First of all, set browser.tabs.insertAfterCurrent to true, then try selecting in this order:
      First unread child tab >> Right sibling tab >> left sibling tab >> Parent tab >> Last accessed tab
      Done! ;-)

  2. Omar said on September 12, 2018 at 5:26 pm
    Reply

    Thank you so much . I like this in opera browser . Any method can do with google chrome ?

  3. TelV said on September 12, 2018 at 5:35 pm
    Reply

    What I do is to pin a blank tab.

  4. Ray said on September 12, 2018 at 6:40 pm
    Reply

    All these tab extensions have one problem when attempting to focus the last active tab: They have to temporarily focus the tab to the right before reactivating the last active tab.

    This one even mentions this in the addon description:

    “The tab that Firefox selects by default may be selected and shown briefly. This is because Firefox 57+ compatible extensions cannot access Firefox’s internal working, so the browser’s default selection cannot be prevented. This extension can only fix it afterwards.”

    Hopefully, Firefox can extend their tab API so this isn’t necessary in the future.

  5. dmacleo said on September 12, 2018 at 7:31 pm
    Reply

    tab mix plus does this too.
    events-tab closing section. few config options.

    1. dmacleo said on September 12, 2018 at 7:33 pm
      Reply

      oops didn’t see this has more options on the order of stuff.
      still, I only use option to prevent accidental closing of browser so TM+ works well for me.

    2. Peterc said on September 13, 2018 at 8:24 pm
      Reply

      @dmacleo: To my knowledge, Tab Mix Plus is an unsupported legacy extension in current versions of Firefox. Firefox doesn’t support XUL/XPCOM extensions at all anymore, and its current WebExtensions framework is missing a large number of APIs that Tab Mix Plus needs in order to work — or at least offer more than a small fraction of the functionality it offered in pre-WebExtensions Firefox.

      Tab Mix Plus 0.5.0.4 seems to be working perfectly in the most recent deprecated (outdated) major releases of Firefox ESR (52.9.0), Tor Browser (7.5.6), and Pale Moon (27.x), and Tab Mix Plus 0.5.5.0 seems to be working almost perfectly* in current Pale Moon (28.x). I’m guessing that one version or the other of Tab Mix Plus also works perfectly or almost perfectly in Waterfox and Basilisk. But I’m not seeing a way to use Tab Mix Plus in the current releases of Firefox Quantum (62.0) or Tor Browser (8.0).

      Along with Session Manager, DownThemAll, and Download Status Bar, Tab Mix Plus is one of my favorite extensions. None of these extensions is supported in Firefox Quantum, and even more than interface customizability, they are the main reason I’ve stuck with Pale Moon as my primary browser. All of the “equivalent” WebExtensions add-ons I’ve seen seem like pale, clunky, incomplete substitutes at best.

      *By “almost perfectly,” I mean that the “Display Opened Tabs List” toolbar button doesn’t work. Everything else I’ve tried does.

  6. John said on September 13, 2018 at 12:26 am
    Reply

    Funny how this add-on gets reviewed, the day after I made a post about it on Reddit!
    No one commented at all!

  7. TomTom said on September 13, 2018 at 1:26 am
    Reply

    Speaking of, I just found out about ffprofile.com. Very useful profile maker when creating a new installation/profile.

  8. few said on September 13, 2018 at 11:51 am
    Reply

    do you mean what firefox does when you try to reopen a closed tab? because if you close a tab, it gets closed, nothing gets opened on its own.

  9. ha said on September 14, 2018 at 5:07 am
    Reply

    A nice addon I have been using since firefox quantum.

  10. Arcionquad said on September 15, 2018 at 3:58 am
    Reply

    A small change makes a big difference! Thanks for the article.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

Please note that your comment may not appear immediately after you post it.