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:

Kā izdarīt - Kā no Firefox kontekstizvēlnes izņemt traucējošu komandu

Kā no "Firefox" kontekstizvēlnes izņemt traucējošu komandu



  1. Atrod komandas CSS selektoru:
    1. atver izstrādātāja rīkus ([F12] vai opciju ikona (---) -> Izstrādātāju rīki -> Pārslēgr rīkus);
    2. atver iestatījumus ([F1] vai opciju ikona (...) -> Iestatījumi);
    3. ieķeksē "Aktivizēt pārlūka un papildinājumu atkļūdošanas rīkus";
    4. ieķeksē "Aktivēt attālināto atkļūdošanu";
    5. atver pārlūka atkļūdošanas rīkus, nospiežot [Ctrl]+[Alt]+[Shift]+[I];
    6. apstiprina "Ienākošo savienojumu" ar "Labi";
    7. pārlūka atkļūdošanas logā nospiež opciju ikonu (...) -> Disable popup auto-hide (kamēr šis ir iespējots, izvēlnes var aizvērt, nospiežot [Esc]);
    8. atver attiecīgo kontekstizvēlni, kurā redzama nevēlamā komanda;
      piemēram, ja grib noņemt "Nosūtīt attēlu...", noklikšķina ar labo peles pogu uz kāda attēla;
    9. pāriet atpakaļ uz pārlūka atkļūdošanas logu;
      ja tas nav redzams un ar peli atvērt citus logus nevar, pāriešanai izmanto operētājsistēmas taustiņu kombinācijas, piem., [Alt]+[Tab];
    10. atrod selektoru līdzīgi kā tīmekļa lapai – ar "Izmeklēt".

    CSS selektors komandai "Nosūtīt attēlu..." ir:
    #context-sendimage
  2. Ieraksta CSS stila deklarāciju, kas komandas elementu paslēpj:
    1. atver "userChrome.css":
      1. opciju ikona (---) -> Palīdzība -> Problēmu novēršanas informācija -> Atvērt mapi;
      2. izveido vai atver mapi "chrome";
      3. izveido vai atver failu "userChrome.css";
    2. saturam pievieno "Nosūtīt attēlu..." paslēpšanas deklarāciju:
      #context-sendimage {
          display: none;
      }
    izmaiņas stājas spēkā pēc faila saglabāšanas un pārlūka pārstartēšanas;
  3. neaizmirstiet atiestatīt izvēļņu automātisko aizvēršanu (un citus iestatījumus, kas mainīti).
  4. ja komanda tomēr nepazūd un izmantojat Firefox 69 vai jaunāku versiju, ir jāiespējo "userChrome.css" ielādēšana (kas pēc noklusējuma ir atspējota, jo it kā mazliet palēninot Firefox atvēršanos):
    1. atver adresi "about:config" (ieraksta adresi adreses joslā un spiež [Enter]);
    2. klikšķina uz "Accept the Risk and Continue";
    3. atrod opciju "toolkit.legacyUserProfileCustomizations.stylesheets" (ielīmē opcijas nosaukumu filtra joslā);
    4. ar peli uz opcijas veic dubultklikšķi, lai pārslēgtu vērtību uz "true";
    5. aizver cilni.

Skatīt arī: