[Firefox Tip] Restore “Close Tabs to the Right” and “Close Other Tabs” Options in Tab Context Menu

This tutorial will help you in moving “Close Tabs to the Right” and “Close Other Tabs” options from new “Close Multiple Tabs” sub-menu to the main tab context menu in newer versions of Mozilla Firefox web browser.

In older versions of Mozilla Firefox web browser, when we right-clicked on a tab in tab bar, we used to get several options in the context menu such as close tab, reload tab, pin tab, bookmark tab, move tab, etc. Among those options, there were following 2 options which were used several times by many Firefox users:

  • Close Tabs to the Right
  • Close Other Tabs

Close_Tabs_To_The_Right_Close_Other_Tabs_Options_Firefox_Context_Menu.png

Advertisement

Close Tabs to the Right” option closes all tabs present at the right-side of the current selected tab. “Close Other Tabs” options closes all tabs except the current selected tab.

In newer versions of Mozilla Firefox web browser, the Mozilla developer team has moved these 2 options to a separate menu called “Close Multiple Tabs”.  Now when you right-click on a tab, you need to first hover mouse cursor over “Close Multiple Tabs” menu and then it displays “Close Tabs to the Right” and “Close Other Tabs” options in a new sub-menu as shown in following screenshot:

Close_Multiple_Tabs_Option_Mozilla_Firefox_Context_Menu.png

The decision to move these 2 options to a separate menu was taken because many Firefox users were clicking on these options accidentally which resulted in losing running tabs and users were having hard time in restoring them. By moving these options to a separate menu will fix this issue and prevent users from mistakenly clicking on these options.

Now there might be many Firefox users who regularly use these 2 options and now they find it annoying and irritating to hover cursor over the new menu and wait for these 2 options to appear on screen.

Today in this article, we’ll tell you how to restore “Close Tabs to the Right” and “Close Other Tabs” options back to the main tab context menu in Firefox. With the help of this article, you’ll be able to move “Close Tabs to the Right” and “Close Other Tabs” options from the separate sub-menu to the main menu.

Following screenshot shows both options re-added to the main tab context menu in Firefox newer versions:

Advertisement

Restore_Close_Tabs_To_The_Right_Close_Other_Tabs_Options_Firefox_Context_Menu.png

To fix this issue, we’ll take help of some CSS style code to force Firefox to hide the new “Close Multiple Tabs” menu option and show “Close Tabs to the Right” and “Close Other Tabs” options in the main tab context menu.

The CSS style code used in this article was provided by “jscher2000” at official Mozilla Support forum in 2018. At that time Firefox 64.0 version was released and it also came with similar change. The only difference was the name of the separate menu. Menu label was “Close Tab Options” instead of “Close Multiple Tabs” at that time.

Fortunately, the same CSS style code still works in the newer Firefox versions to move “Close Tabs to the Right” and “Close Other Tabs” options to the main tab context menu.

PS: I have modified a few values in the original code to fix position issue of both options.

If you also want to move these 2 options to the main tab right-click menu, following steps will help you:

STEP 1: Enable CSS Stylesheet Code Support in Firefox

Since we are going to use CSS style code, we’ll need to first enable support for CSS code in Firefox by modifying a preference/flag using about:config page. Just set toolkit.legacyUserProfileCustomizations.stylesheets preference to true on about:config page to enable support for CSS code.

Restore_Enable_Support_UserChrome_UserContent_CSS_Files_Mozilla_Firefox.png

Following article contains step-by-step guide for it:

[Fix] userChrome.css and userContent.css Codes Stopped Working After Firefox Upgrade

STEP 2: Download userChrome.css File

Now we’ll apply the CSS code. We’ll take help of a built-in file userChrome.css to implement our custom-made CSS code. This file doesn’t exist by default and we’ll need to manually create the file.

For your convenience, we have created a ready-made userChrome.css file. Download following ZIP file, extract it using 7-Zip or other file archive software and you’ll get userChrome.css file:

STEP 3: Copy userChrome.css File to Firefox Profile Folder

Now we’ll put the downloaded userChrome.css file inside our Firefox profile folder. You can directly open your Firefox profile folder using following steps:

  • Type about:support in address bar and press Enter. It’ll open Troubleshooting Information page.
  • Now look for “Profile Folder” option. Click on “Open Folder” button.

Open_Mozilla_Firefox_Profile_Folder_About_Support_Page.png

It’ll open your current Firefox profile folder.

Now create a new folder with the name chrome inside the profile folder. Right-click on empty area and select New-> Folder option. Or you can press Ctrl+Shift+N keys together to directly create a new folder.

Create_Chrome_Folder_Mozilla_Firefox_Profile.png

Set the new folder name as chrome and press Enter key.

PS: Some users may already have chrome folder in their profile folder.

Now copy the downloaded userChrome.css file and paste it inside the newly created chrome folder.

Create_UserChrome_CSS_File_Chrome_Folder_Mozilla_Firefox_Profile.png

PS: If you already have userChrome.css file in chrome folder, you’ll need to copy the text given in downloaded userChrome.css file and paste it at the top of existing userChrome.css file and save the file.

NOTE: Ignore the other userContent.css file shown in above screenshot. It was created for other purpose mentioned in this tutorial.

STEP 4: Restart Firefox to Apply Changes

At last, you’ll need to restart Firefox to apply changes. If you have opened multiple tabs and you don’t want to lose them, you can restart Firefox without losing tabs using methods given in following tutorial:

[Tip] How to Restart Mozilla Firefox Without Losing Tabs

That’s it. Restart Firefox browser and now you’ll see both “Close Tabs to the Right” and “Close Other Tabs” options in main tab context menu.

IMPORTANT INFORMATION:

There is a known issue or glitch in the above mentioned solution or workaround. When you’ll right-click on a tab, both option “Close Tabs to the Right” and “Close Other Tabs” will not appear by default. You’ll see a blank space or gap at the bottom of the menu. When you’ll move your mouse cursor on the blank space, both options will immediately appear on screen. So to access the options, you’ll need to hover on them.

Thanks again to “jscher2000” at Mozilla Support forum for sharing the code…

Also Check:

[Tip] The Best Working Method to Get Classic Address bar in Mozilla Firefox

Published in: Mozilla Firefox

About the author: Vishal Gupta (also known as VG) has been awarded with Microsoft MVP (Most Valuable Professional) award. He holds Masters degree in Computer Applications (MCA). He has written several tech articles for popular newspapers and magazines and has also appeared in tech shows on various TV channels.

Comments

NOTE: Older comments have been removed to reduce database overhead.

  1. Doesn’t Work.

    Shows a blank (Height Increased) Menu Item Which Has Submenu for close tabs to right & Close Other Tabs.

    🙁

  2. I use the close tabs to the right option heavily and a dislike the submenu change you address here. I would prefer to have a keyboard shortcut for these options as well. I keep asking the Firefox team to consider it but so far they have not.

Leave a Comment

Your email address will not be published. Required fields are marked *

NOTE: Your comment may not appear immediately. It'll become visible once we approve it.