![Firefox logo](https://assets-prod.sumo.prod.webservices.mozgcp.net/media/uploads/products/2020-04-14-08-36-13-8dda6f.png)
How to hide tab close button
Hello,
In past versions of firefox there was a config option to hide the tab close button but this got removed. I got accustomed to closing tabs with the mouse middle click so I don't need that button. It gets in the way when I try to switch tabs and I accidentally click it.
Is there a way to hide it in newer versions of firefox (56, 57)?
Thank you.
Valittu ratkaisu
You can add code to the userChrome.css file below the default @namespace line to hide the close buttons.
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */ #tabbrowser-tabs .tabbrowser-tab .tab-close-button { display:none!important; }
You can use the button on the "Help -> Troubleshooting Information" (about:support) page to go to the current Firefox profile folder or use the about:profiles page.
- Help -> Troubleshooting Information -> Profile Directory:
Windows: Show Folder; Linux: Open Directory; Mac: Show in Finder - http://kb.mozillazine.org/Profile_folder_-_Firefox
- create the chrome folder (lowercase) in the <xxxxxxxx>.default profile folder if this folder doesn't exist
- use a plain text editor like Notepad to create a (new) userChrome.css file in the chrome folder (file name is case sensitive)
- paste the code in the userChrome.css file in the editor window
- make sure that the userChrome.css file starts with the default @namespace line
- make sure that you select "All files" and not "Text files" when you save the file via "Save file as" in the text editor as userChrome.css.
otherwise Windows may add a hidden .txt file extension and you end up with a not working userChrome.css.txt file
Kaikki vastaukset (3)
Maybe you'd like to give this add-on a try - which does what the preference in 'about:config' used to do :
https://addons.mozilla.org/en-US/firefox/addon/no-close-buttons/
Valittu ratkaisu
You can add code to the userChrome.css file below the default @namespace line to hide the close buttons.
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */ #tabbrowser-tabs .tabbrowser-tab .tab-close-button { display:none!important; }
You can use the button on the "Help -> Troubleshooting Information" (about:support) page to go to the current Firefox profile folder or use the about:profiles page.
- Help -> Troubleshooting Information -> Profile Directory:
Windows: Show Folder; Linux: Open Directory; Mac: Show in Finder - http://kb.mozillazine.org/Profile_folder_-_Firefox
- create the chrome folder (lowercase) in the <xxxxxxxx>.default profile folder if this folder doesn't exist
- use a plain text editor like Notepad to create a (new) userChrome.css file in the chrome folder (file name is case sensitive)
- paste the code in the userChrome.css file in the editor window
- make sure that the userChrome.css file starts with the default @namespace line
- make sure that you select "All files" and not "Text files" when you save the file via "Save file as" in the text editor as userChrome.css.
otherwise Windows may add a hidden .txt file extension and you end up with a not working userChrome.css.txt file
@Engima thanks for the answer, but addons that do that don't work starting with firefox 57. I'm on 57 beta and I could switch to 56 stable to use that addon but it would only postpone the problem.
@cor-el thank you, that worked. I hope Mozilla doesn't plan to remove userChrome.css any time soon.