I. Problem:
Remove or hide specific items from Firefox context menu (right-click menu), such as:
• "Take Screenshot"
• "Inspect"
• "Inspect Accessibility Properties"
• "View Page Source"
• "Select All"
• "Ask AI"
• "Print Selection"
• "Translate Selection"
• "View Selection Source".
II. Solution:
• Use Firefox's about:config
settings to disable certain features entirely
or
• Use userChrome.css
to hide individual menu items via CSS rules.
III. Instruction:
• Open Firefox and go to about:profiles
.
• Find the user profile which is marked as "This is the profile in use and it cannot be deleted."
Click Open Directory
next to Root Directory
.
• In the profile folder, create a folder named chrome
if it doesn't exist.
• Inside chrome
, create or edit a file named userChrome.css
.
• To disable context menu items you consider unnecessary, edit the userChrome.css
file:
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/* Hide "Take Screenshot" */
#context-screenshot {
display: none !important;
}
/* Hide "Inspect" */
#context-inspect {
display: none !important;
}
/* Hide "Inspect Accessibility Properties" */
#context-inspect-a11y {
display: none !important;
}
/* Hide "View Page Source" */
#context-viewsource {
display: none !important;
}
/* Hide "Select All" */
#context-selectall {
display: none !important;
}
/* Hide "Print Selection" */
#context-print-selection {
display: none !important;
}
/* Hide "Translate Selection" */
#context-translate-selection {
display: none !important;
}
/* Hide "View Selection Source" */
#context-viewpartialsource-selection {
display: none !important;
}
With this done, you have hidden menu items by adding multiple custom CSS rules.
• In Firefox open new tab with the address about:config
.
• Find the toolkit.legacyUserProfileCustomizations.stylesheets
flag and set it to true
.
• Restart Firefox completely.
IV. Result:
• After applying these settings and restarting Firefox, the specified context menu items will be removed or hidden as requested.
• Disabling features via about:config completely removes their functionality and menu items.
• Using userChrome.css
allows selective hiding of menu items without disabling the underlying feature.
• This provides flexible control over Firefox's context menu appearance.
You may also like the second, more tough, way to exclude menu items by disabling entire features, which removes corresponding menu items automatically:
• To disable screenshots feature (removes "Take Screenshot"), change screenshots.browser.component.enabled
to false
in about:config
.
• To disable "Ask ChatGPT" menu item, change browser.ml.chat.enabled and browser.ml.chat.shortcuts
to false
in about:config
.
• To disable accessibility tools (removes "Inspect Accessibility Properties"), change devtools.accessibility.enabled
to false
.
Top comments (0)