5

It was once possible to edit firefox's context menus by using various extensions - which no longer exist. Presumably firefox's APIs changed, so those extensions stopped working and were delisted.

My context menus are full of junk items I never use, many were added by extensions. I'd like to remove those I don't want, and maybe reorder those than remain.

How do I do that for the latest (104) firefox?

(I'd prefer a built-in method or an extension, rather than fiddling with css/etc.)

4
  • Have you tried the advice in this post for doing it via userChrome.css?
    – harrymc
    Jan 27, 2023 at 8:06
  • @harrymc No I haven't. From experience I've learnt messing with the user chrome eventually causes more trouble. So as stated above I'm hoping there's a robust approach. I'm sure your link would be of interest to others though, so thanks.
    – lonix
    Jan 27, 2023 at 10:34
  • 1
    Sorry, extensions nowadays cannot modify context menus, other than adding their own items. I think you should check if the userChrome.css method still works (with no guarantee that it will persist).
    – harrymc
    Jan 27, 2023 at 11:04
  • @harrymc I didn't know that, thanks. A pity though. I've always hated hacking the user chrome, as at some version in the future my changes are inevitably overwritten or ignored, or something. Oh well! :)
    – lonix
    Jan 27, 2023 at 11:29

2 Answers 2

3
+50

Negative answer : Firefox, for security considerations, nowadays doesn't permit extensions any more to modify existing context menu entries. Extensions are only allowed to add, modify, or delete their own additions to the menu.

That means that it's not possible any more to write an extension that will unclutter the context menu.

You can only remove items from a cluttered context menu by removing the extension that added them, or change some option in the settings of the extension (if it has such an option).

0

It's possible with some manual adjustments via userChrome.css. I just tested it on Windows FF 121.0.1.

The original content is by Jānis Elmeris whom I thank very much!

Enable userChrome.css customizations in latest Firefox versions:
    Open about:config
    Set toolkit.legacyUserProfileCustomizations.stylesheets = true

Find menu item ID:
    Open developer tools (F12)
    Open the settings (F1)
    Check "Enable browser chrome and add-on debugging toolboxes"
    Check "Enable remote debugging"
    Open browser debugging (Ctrl-Alt-ShiftI), accept incoming connection
    In the browser debugging click on options button (...) > Disable popup auto-hide 
    Open FF context menu
    In the browser debugging use "Inspect Element" to find the victim menu item
        E.g. the CSS selector for option "Copy Link" is: #context-copylink

Create "userChrome.css":
    Open FF profile: Help > Troubleshooting Information > Profile Directory
    Create "chrome" folder
    Create "userChrome.css"
    Hide menu item by adding the found CSS selector to the userChrome.css:
        #context-copylink {
            display: none;
        }

After adding all the desired menu items restart Firefox

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .