Hide several context menu items

User Help for Mozilla Firefox
Post Reply
User avatar
ygoe
Posts: 215
Joined: November 10th, 2003, 2:51 pm
Location: Germany
Contact:

Hide several context menu items

Post by ygoe »

I'm using the userChrome.css file to customise the Firefox GUI and remove some unnecessary clutter. That includes a lot of context menu items I'll never use. I've already found the IDs for "Send page to device" and "Send link to device", including their separators. But can somebody please tell me the IDs for "Send tab to device" and "Take screenshot"? (Not sure about these names, I have them in German.)

This is what I've got so far:

Code: Select all

#context-openlink,   /* Open link in a new window */
#context-bookmarklink,   /* Add bookmark for this link */
#context-sendlink,   /* Send link */
#context-sendimage,   /* Send image */
#context-setDesktopBackground,   /* Set image as desktop background */
/* ... */
#contentAreaContextMenu #context-sendpagetodevice,   /* Send page to device */
#contentAreaContextMenu #context-sep-sendpagetodevice,   /* Send page to device - separator */
#contentAreaContextMenu #context-sendlinktodevice,   /* Send link to device */
#contentAreaContextMenu #context-sep-sendlinktodevice   /* Send link to device - separator */
{
	display: none !important;
}
Guesswork didn't help.
User avatar
MarkRH
Posts: 1360
Joined: September 12th, 2007, 2:30 am
Location: Edmond, OK
Contact:

Re: Hide several context menu items

Post by MarkRH »

Here's what I got for 57:

Code: Select all

/*
 * Remove "Send Page to Device", "Send Link to Device", 
 * "Send Tab to Device" from context menu.
 *
 * Contributor(s): PilzAdam
 * https://github.com/Timvde/UserChrome-Tweaks/blob/master/context-menu/remove-send-to-device.css
 */
 
#context-sendpagetodevice, #context-sep-sendpagetodevice,
#context-sendlinktodevice, #context-sep-sendlinktodevice,
#context_sendTabToDevice, #context_sendTabToDevice_separator {
  display: none !important;
}
 
For the screenshot, I just disabled it in about:config, set extensions.screenshots.disabled to true.
morat
Posts: 6421
Joined: February 3rd, 2009, 6:29 pm

Re: Hide several context menu items

Post by morat »

Omit.
Last edited by morat on October 14th, 2017, 11:02 am, edited 1 time in total.
User avatar
ygoe
Posts: 215
Joined: November 10th, 2003, 2:51 pm
Location: Germany
Contact:

Re: Hide several context menu items

Post by ygoe »

The scratchpad thing doesn't work. It gives me:

Exception: TypeError: document.getElementsByAttribute is not a function
@Scratchpad/1:10:7
User avatar
ygoe
Posts: 215
Joined: November 10th, 2003, 2:51 pm
Location: Germany
Contact:

Re: Hide several context menu items

Post by ygoe »

The CSS selector of MarkRH works in Firefox 56. Thank you!

But I didn't want to disable the screenshots feature altogether yet. It has already been useful once. I just don't want it in the page context menu, the main menu tile is enough for me. (I moved the toolbar button into the menu.)
Post Reply