Firefox has inconsistent behaviour when it comes to opening new tabs. Sometimes they open in the foreground (i.e. switching to it immediately) and the background (not switching and staying in the current tab).
Examples:
- Middle or CTRL clicking on a standalone bookmark in the bookmark bar will cause it to immediately switch to the new tab. This can be changed by setting browser.tabs.loadBookmarksInBackground to true, but this only changes it for single, standalone bookmarks, not folders. If you middle or CTRL click on a folder of bookmarks, it switches to the first open tab. There is no way to make middle or CTRL clicking folders of bookmarks open in the background.
- 2 of the other "open new tabs in background" settings are browser.search.context.loadInBackground, which controls whether right clicking on highlighted text and selecting "search {search engine} for "{highlighted text}" opens in the fore or background), and browser.tabs.loadDivertedInBackground, which controls whether new pages opened from other applications (like clicking a link in a different application while Firefox is open) immediately switches to the newly opened tab or not.
- browser.bookmarks.openInTabClosesMenu controls whether middle/CTRL clicking on individual bookmarks in folders will close the menu or not.
- Right clicking on the back button and middle/CTRL clicking to open previous pages will immediately switch to the newly opened tab. There is no way to make it stay in the background and not close the right click menu. This is annoying when trying to open multiple previous pages.
- Searching for something that yields multiple suggestions in the address bar and middle/CTRL clicking the results opens a new tab in the foreground and makes it very annoying to open multiple suggestions from the address bar search. Middle/CTRL clicking should open the new tabs in the background and not cause the suggestions to go away, so users can quickly open multiple new tabs from the suggestions list.
Suggested improvements:
- Anywhere where middle/CTRL clicking to open a new tab switches to the new tab (as detailed in the non exhaustive list above) and there is no setting for it, should have one, whether it be via individual settings or a global one.
- These settings should be hooked up to the browser settings pages, not hidden away in about:config. You could start out with a simple global toggle for opening new tabs in the fore or background, with more advanced individual toggles for people who want to customise this behaviour for different situations.
- If the above are implemented, the new default should be having every new tab open in the background when middle/CTRL clicked on. If a user middle/CTRL clicks on a link, they expect the new tab to be opened in the background, because they plan to open multiple new tabs. If they wanted to immediately see the newly opened tab, they wouldn't be middle/CTRL clicking on it. Even if they want to see the new tab immediately after middle/CTRL clicking it, they can still switch to the new tab themselves. Force switching to the new tab is a very jarring user experience.
- The one exception to 3 is the browser.tabs.loadDivertedInBackground setting. Most users would probably expect the browser to be brought to the foreground and switched to the new tab. Otherwise there will be reports of Firefox not opening links and users not realising Firefox just didn't bring itself to the foreground and show the new tab. So the default for this should be off. Obviously there should still be an option in the settings for this and not have it hidden away in about:config.
Chromium browsers handle this a lot better than Firefox. Most of their new tabs opened from middle/CTRL clicks open in the background.
The only exception is middle/CTRL clicking to open multiple previous pages in the right click back button menu. There is also no equivalent for browser.tabs.loadDivertedInBackground, so having a Chromium browser set as the default and clicking on a link from an outside application or opening a PDF with the browser set to the default PDF reader will always bring the browser to the foreground and switched to the new tab.
This might all sound really nitpicky, but this would all massively improve the QoL for anyone who uses middle/CTRL clicking to open multiple links in new tabs. If the flaws in Chromium's "open in new tab" behaviour (detailed in the paragraph above) can also be improved upon, then this would put Firefox above Chromium when it comes to opening stuff in new tabs.