Is it possible to edit the context menus when I right click on tabs? I'm tired of accidentally missing the "duplicate tab", clicking "pin tab", and having to said tab back into place.
You can see the context menu in the photo, I would want to hide the pin tabs button so I could stop clicking it on accident. Pinned aren't a feature I use nor find useful anyway.
All Replies (5)
Note that you can middle-click or hold the Ctrl key (Mac:Command) and left-click the Reload toolbar button to duplicate the current tab to a new tab.
This context menu item has this ID: #context_duplicateTab
Add CSS code to the userChrome.css file in the chrome folder in the Firefox profile folder.
#context_duplicateTab { display: none !important; }
It is not that difficult to create userChrome.css if you have never used it.
The first step is to open the "Help -> Troubleshooting Information" page and find the button to access the profile folder with the random name (xxxxxxxx.default-release).
You can find the button to go to the profile folder under the "Application Basics" section as "Profile Folder -> Open Folder". If you click this button then you open the profile folder in the Windows File Explorer. You need to create a folder with the name chrome in the profile folder with the random name (name is all lowercase). In the chrome folder you need to create a plain text file with the name userChrome.css (name is case sensitive). In this userChrome.css text file you paste the text posted. On Mac you can use the TextEdit utility to create the userChrome.css file as a plain text file. You need to close (Quit/Exit) and restart Firefox when you create or modify the userChrome.css file.
More info about userContent.css and userChrome.css in case you are not familiar: *https://www.userchrome.org/what-is-userchrome-css.html
- https://www.userchrome.org/how-create-userchrome-css.html
- https://www.userchrome.org/firefox-changes-userchrome-css.html
In Firefox 69 and later you need to set this pref to true on the about:config page to enable userChrome.css and userContent.css in the chrome folder.
- about:config => toolkit.legacyUserProfileCustomizations.stylesheets = true
- https://support.mozilla.org/en-US/kb/about-config-editor-firefox
I already have userChrome.css setup but thanks for the instructions anyway, they would be helpful for users who haven't set up custom CSS before.
I'll say however, that it doesn't work because Firefox for Mac uses macOS' native context menus (as you could see in the photo), which are unaffected by CSS completely.
Modified
You can possibly disable native context menus on Mac via about:config.
- about:config => widget.macos.native-context-menus = false
- https://support.mozilla.org/en-US/kb/about-config-editor-firefox
While I could do that, is it possible to hide it without disabling native context menus? And there's also the possibility of Mozilla removing the flag in the future, as they have done for many flags of legacy features.
Like you wrote above, userChrome.css can't be used to affect the context with native context menus.