MozillaZine


[v89] Remove context menu image-related items?[Mac.]

User Help for Mozilla Firefox
Cheekeh Munkeh
 
Posts: 142
Joined: April 26th, 2009, 1:36 am

Post Posted June 3rd, 2021, 4:11 am

This previously prescribed solution:

https://support.mozilla.org/en-US/questions/1116486

to remove the "Set Image as Desktop Background" and "Email Image" from the context menu items no longer functions in v89.

Anyone know of a solution that will work going forward?
Without having to resort to a policy file?
Last edited by LIMPET235 on June 4th, 2021, 5:36 am, edited 1 time in total.
Reason: Added [Mac] to the Title.

morat
 
Posts: 4685
Joined: February 3rd, 2009, 6:29 pm

Post Posted June 3rd, 2021, 6:09 am

Try this:

Code: Select all
/* Firefox userChrome.css */

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

#context-sendimage,
#context-sep-setbackground,
#context-setDesktopBackground {
  display: none !important;
}

http://kb.mozillazine.org/UserChrome.css

Remember to set the toolkit.legacyUserProfileCustomizations.stylesheets preference to true, then restart.

P.S.

The ids didn't change in Fx 89.

Reference
http://searchfox.org/mozilla-release/se ... egexp=true
http://searchfox.org/mozilla-release/source/browser/config/version.txt

Cheekeh Munkeh
 
Posts: 142
Joined: April 26th, 2009, 1:36 am

Post Posted June 3rd, 2021, 2:18 pm

Thanks, but it didn't work.

I've been using that code, minus the separator line, in the same userchrome file, for many versions of Fx and it has been effective up until now.

I have one extension that modifies the context menu to provide search options, but disabling it made no difference.

Nor did disabling all extensions and running in that mode.

I've made other changes in the file, to tweak other elements new to v89, and they work as expected, so it's not an issue of the userchrome file not being read and functional.

morat
 
Posts: 4685
Joined: February 3rd, 2009, 6:29 pm

Post Posted June 3rd, 2021, 2:31 pm

I don't know what's wrong.

Troubleshoot userChrome.css
http://forums.mozillazine.org/viewtopic.php?p=14887480#p14887480

dickvl

User avatar
 
Posts: 53492
Joined: July 18th, 2005, 3:25 am

Post Posted June 3rd, 2021, 3:27 pm

Maybe post your full userChrome.css so we can check for issues.
You can also try to move the new code to the top of the file.

Cheekeh Munkeh
 
Posts: 142
Joined: April 26th, 2009, 1:36 am

Post Posted June 3rd, 2021, 10:54 pm

Alright, I tried moving the specific code to be first in the file. Also removing the commenting remarks. No joy.

Here's the file in its entirety. As you can see, it's not complex. I've even left the remarks at the top intact, from whenever it was that Fx generated the file on its own automatically, a long time ago.

The other two mods, the persistent tab close buttons, and the tab bar background color (just added for v89), do work. Only the context menu item does not.

Disabling extensions, and restarting in safe mode. No joy. Puzzling.

Code: Select all
/*
 * Edit this file and copy it as userChrome.css into your
 * profile-directory/chrome/
 */

/*
 * This file can be used to customize the look of Mozilla's user interface
 * You should consider using !important on rules which you want to
 * override default settings.
 */

/*
 * Do not remove the @namespace line -- it's required for correct functioning
 */


@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */


/* Always show close button */

    .tab-close-button {
      display: -moz-box !important;
    }


/* Remove image options from context menu */

#context-sendimage,
#context-setDesktopBackground {
  display: none !important;
}


/* Set Tab bar color to match window title bar */

#titlebar > toolbar{ background-color: #d8d8db !important; }

Luna C

User avatar
 
Posts: 40
Joined: June 9th, 2007, 11:36 am

Post Posted June 5th, 2021, 4:54 am

I'm having the same problem with the context menu items not being removed with userchrome.css, and am also on a Mac. The other changes work perfectly.

Is it a Mac thing?


Code: Select all

/* * Do not remove the @namespace line — it’s required for correct functioning */
/* set default namespace to XUL */
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");



/******** HIDE STUFF *******/


 /* Hide context menu items */
#context-back,
#context-forward,
#context-reload,
#context-stop,
#context-sep-stop
{display: none !important;}


/* Make tab close show only on hover */
.tab-close-button {visibility: collapse !important;}
.tabbrowser-tab:hover .tab-close-button {color: #6E6E6E !important; visibility: visible !important;}


/* Remove back button when nothing to go back to */
#back-button[disabled="true"] {display: none;}
#forward-button[disabled="true"] {display: none;}


/* Hide hamburger menu in toolbar */
#PanelUI-menu-button {display: none !important;}



morat
 
Posts: 4685
Joined: February 3rd, 2009, 6:29 pm

Post Posted June 5th, 2021, 5:14 am

Try setting the widget.macos.native-context-menus pref to false, then restart.

Mac native context menus fail to honor CSS rules
http://bugzilla.mozilla.org/show_bug.cgi?id=1712734

Use native context menus on Mac
http://bugzilla.mozilla.org/show_bug.cgi?id=34572

For reading only as Bugzilla is not a forum.

Luna C

User avatar
 
Posts: 40
Joined: June 9th, 2007, 11:36 am

Post Posted June 5th, 2021, 5:25 am

That worked, thank you very much!

Cheekeh Munkeh
 
Posts: 142
Joined: April 26th, 2009, 1:36 am

Post Posted June 5th, 2021, 2:40 pm

morat wrote:Try setting the widget.macos.native-context-menus pref to false, then restart.

Mac native context menus fail to honor CSS rules
http://bugzilla.mozilla.org/show_bug.cgi?id=1712734

Use native context menus on Mac
http://bugzilla.mozilla.org/show_bug.cgi?id=34572

For reading only as Bugzilla is not a forum.


Hallelujah. Thanks, that worked. I should have known better and searched for a bug.

Additional thanks for posting the searchfox link. Using it to determine the IDs. I took the opportunity to remove additional items as well, and further tidy up the context menu to my liking.

Return to Firefox Support


Who is online

Users browsing this forum: Bing [Bot] and 11 guests