2018-08-18

How to remove an option from Firefox context menu

How to remove an option from Firefox context menu



  1. Look up the CSS selector of the option:
    1. open developer tools ([F12] or options button (---) -> Web Developer -> Toggle Tools);
    2. open the settings ([F1] or options button (...) -> Settings);
    3. select checkbox "Enable browser chrome and add-on debugging toolboxes";
    4. select checkbox "Enable remote debugging";
    5. open browser debugging toolbox by pressing [Ctrl]+[Alt]+[Shift]+[I];
    6. confirm "Incoming Connection" by "OK";
    7. in the browser debugging toolbox, click on options button (...) -> Disable popup auto-hide (you can manually close the popups by pressing [Esc]);
    8. open a context menu the option appears in;
      for example, if you want to remove "Email Image...", right-click on some image on any web page;
    9. switch back to the browser debugging toolbox window;
      if it is not visible and cannot be switched to by using the mouse, use the appropriate key shortcuts, e.g., [Alt]+[Tab];
    10. look up the selector as with a web page – using "Inspect Element".

    The CSS selector for option "Email Image..." is:
    #context-sendimage
  2. Add a CSS definition that hides the element:
    1. open "userChrome.css":
      1. options button (---) -> Help -> Troubleshooting Information -> Open Directory;
      2. create or open folder "chrome";
      3. create or open file "userChrome.css";
    2. add a CSS definition to the content of the file, that would hide "Email Image..." element:
      #context-sendimage {
          display: none;
      }
    changes take effect once you've saved the file and restarted the browser;
  3. do not forget to reset the popup auto-hide option (and other settings that were changed).
  4. if the customisations do not get applied and you're using Firefox ≥69, you need to enable the loading of "userChrome.css" (which is disabled by default because it supposedly slows down the startup of Firefox a bit):
    1. open address "about:config" (type it into the address bar and press [Enter]);
    2. click on "Accept the Risk and Continue";
    3. find option "toolkit.legacyUserProfileCustomizations.stylesheets" (paste its name into the filter bar);
    4. double-click on the option to switch it to "true";
    5. close the tab.

See also:

4 komentāri:

  1. This is complete nonsense. Here is the problem block of the instructions:
    "The CSS selector for option "Email Image..." is:

    #context-sendimage

    Add a CSS definition that hides the element:

    open "userChrome.css":
    options button (---) -> Help -> Troubleshooting Information -> Open Directory;"

    The bottleneck is "options button (---) -> Help" There IS NOT any option button AT ALL, and pressing F1 closes the window you're supposed to do the work in.

    Thanks for NOTHING.

    AtbildētDzēst
  2. gremlinkurs,

    by the options button I mean the hamburger icon on the top right corner – the same you clicked to get the "Toggle Tools" option. If you've gotten to "Open Directory" part, it's OK to lose the previous window, it's not important anymore, as long as you have the selector copied (or remembered).

    AtbildētDzēst
  3. Šo komentāru ir noņēmis autors.

    AtbildētDzēst