We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

搜尋 Mozilla 技術支援網站

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

了解更多

Is there a possibility to remove entries from the context menu?

  • 3 回覆
  • 2 有這個問題
  • 3 次檢視
  • 最近回覆由 itsholger

more options

I would like to remove several items from my context menu to de-clutter. Some items come from extensions (e.g. "Kee"), others are Firefox features which I'd rather trigger from the address bar (such as "Send page to device" or "Save Page to Pocket" or "Take a screenshot").

Since Menu Wizard doesn't support WebExtensions, it seems there is neither an extension that has this functionality nor a feature from Firefox that would allow this. I've heard that meddling with the userchrome.css may achieve this result, but unfortunately I couldn't find a good tutorial to do so. I'd be grateful for any pointers. Thanks!

I would like to remove several items from my context menu to de-clutter. Some items come from extensions (e.g. "Kee"), others are Firefox features which I'd rather trigger from the address bar (such as "Send page to device" or "Save Page to Pocket" or "Take a screenshot"). Since Menu Wizard doesn't support WebExtensions, it seems there is neither an extension that has this functionality nor a feature from Firefox that would allow this. I've heard that meddling with the userchrome.css may achieve this result, but unfortunately I couldn't find a good tutorial to do so. I'd be grateful for any pointers. Thanks!

被選擇的解決方法

Unfortunately it may take a bit of effort meddling with userChrome.css, but once you know what is required, it should be easy, or just a matter of copy and paste for the appropriate code provided/found.

1. Open your profile folder as instructed in the Profiles support article, or enter about:support in the address bar, press Enter/Return and click the Open Folder / Open Directory / Show in Finder button next to Profile Folder (Windows / Linux / Mac, resp.). On Mac, enter the displayed profile folder; on Windows/Linux you should land in there.

2. Create a subfolder named chrome in that (active) profile folder if it doesn’t exist, enter it, create a text file called userChrome.css there and paste or add the following code into it. (Similar instructions can be found here.)

@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);

/* Send Page to Device + top separator */
#context-sendpagetodevice, #context-sep-sendpagetodevice { 
  display: none !important; 
}

/* Save Page to Pocket */
#context-pocket { 
  display: none !important; 
}

/* Take a Screenshot + Inspect Element separator */
#screenshots_mozilla_org-menuitem-_create-screenshot, #inspect-separator { 
  display: none !important; 
}

/* Move "Inspect Element" down the menu */
#context-inspect {
  -moz-box-ordinal-group: 20 !important;
}

3. Save the userChrome.css file and restart Firefox. The items you mentioned above should no longer be there.

More info about editing the context menu and hiding its items can be found here. For add-ons such as Kee, you would need to find the id’s of CSS selectors as instructed there using DevTools. If you understand how the CSS file works, it should be fairly easy to find and add them.

從原來的回覆中察看解決方案 👍 1

所有回覆 (3)

more options

Hi, I'm sorry but there currently doesn't seem to be an easy way to do this. Try looking or make a thread on https://reddit.com/r/FirefoxCSS and see if they can help.

more options

選擇的解決方法

Unfortunately it may take a bit of effort meddling with userChrome.css, but once you know what is required, it should be easy, or just a matter of copy and paste for the appropriate code provided/found.

1. Open your profile folder as instructed in the Profiles support article, or enter about:support in the address bar, press Enter/Return and click the Open Folder / Open Directory / Show in Finder button next to Profile Folder (Windows / Linux / Mac, resp.). On Mac, enter the displayed profile folder; on Windows/Linux you should land in there.

2. Create a subfolder named chrome in that (active) profile folder if it doesn’t exist, enter it, create a text file called userChrome.css there and paste or add the following code into it. (Similar instructions can be found here.)

@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);

/* Send Page to Device + top separator */
#context-sendpagetodevice, #context-sep-sendpagetodevice { 
  display: none !important; 
}

/* Save Page to Pocket */
#context-pocket { 
  display: none !important; 
}

/* Take a Screenshot + Inspect Element separator */
#screenshots_mozilla_org-menuitem-_create-screenshot, #inspect-separator { 
  display: none !important; 
}

/* Move "Inspect Element" down the menu */
#context-inspect {
  -moz-box-ordinal-group: 20 !important;
}

3. Save the userChrome.css file and restart Firefox. The items you mentioned above should no longer be there.

More info about editing the context menu and hiding its items can be found here. For add-ons such as Kee, you would need to find the id’s of CSS selectors as instructed there using DevTools. If you understand how the CSS file works, it should be fairly easy to find and add them.

more options

Thank you Tonnes! That reddit link is great. Was able to de-clutter my context menu by so much. Didn't expect an answer after six months but this was a blessing!

For anyone interested, my userChrome.css:

@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);

/* Send Page / Link / Tab to Device + top separator */
#context-sendpagetodevice, #context-sep-sendpagetodevice,
#context-sendlinktodevice, #context-sep-sendlinktodevice,
#context_sendTabToDevice, #context_sendTabToDevice_separator {
	display: none !important; 
}

/* Open Link in New Window */
#context-openlink {
	display: none !important; 
}

/* View Background Image */
#context-viewbgimage, #context-sep-viewbgimage {
	display: none !important; 
}

/* Save Page as */
#context-savepage {
	display: none !important; 
}

/* Save Page / Link to Pocket as */
#context-pocket,
#context-linktopocket {
	display: none !important; 
}

/* Take a Screenshot */
#screenshots_mozilla_org-menuitem-_create-screenshot, #screenshots_mozilla_org_create-screenshot {
	display: none !important; 
}

/* Inspect Element separator  */
#inspect-separator {
	display: none !important; 
}

/* Move "Inspect Element" down the menu */
#context-inspect {
	-moz-box-ordinal-group: 20 !important; 
}


/* Add-on: Video DownloadHelper */
#_b9db16a4-6edc-47ec-a1f4-b86292ed211d__vdh-main {
	display: none !important; 
}

/* Add-on: KeeFox */
[id^="keefox_chris_tomlinson_"] {
	display: none !important; 
}

由 itsholger 於 修改