2

I just want to get rid of some Firefox context menu, such as: "set as desktop background" "email image" "bookmark link"

Now in Firefox, addons cannot change context menu. I have tried to add

#context-setDesktopBackground {display:none!important}

to the userChrome.css file, but it also not working. Is there any solution?

UPDATE I have tried also

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

#context-setDesktopBackground {display:none!important}

And also not working:

enter image description here

I followed this tutorial.

Destroy666
  • 12,350
XuMuK
  • 415

1 Answers1

2

I tested and the GitHub solution still works fine in latest Firefox. You likely failed to follow instructions in a way or another - please specify what you tried exactly in your question next time.

Here very simplified instructions for Windows 10 (based on this repo):

  1. Open about:config page in Firefox and search for toolkit.legacyUserProfileCustomizations.stylesheets. Set it to true if it's false by e.g. double clicking the value.
  2. Create userChrome.css file in %APPDATA%\Mozilla\Firefox\Profiles\[profile-id]\chrome:
  • %APPDATA% is C:\Users\[user]\AppData\Roaming
  • profile-id dir should be the one with latest date modified, if you used Firefox recently
  • chrome dir at the end might not exist, you need to create that too then
  1. Add this to that file:
#context-sep-setbackground, #context-setDesktopBackground, #context-setDesktopBackground { display:none !important; }

This removes the Set Image as Desktop Background... entry and separators, as an example. Selectors are taken from here, you can check for other ones in other files, for each type of context menu.

  1. Save the file and (re)open Firefox. Menu entry should be gone.
Destroy666
  • 12,350