Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

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.

  • 5 回覆
  • 0 有這個問題
  • 1 次檢視
  • 最近回覆由 cor-el

more options

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.

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.
附加的畫面擷圖

所有回覆 (5)

more options

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

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.

more options

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.

由 TheWonderAlmighty 於 修改

more options

You can possibly disable native context menus on Mac via about:config.

more options

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.

more options

Like you wrote above, userChrome.css can't be used to affect the context with native context menus.