Hide various menu/context options

User Help for Mozilla Firefox
Post Reply
andrew_wrobel
Posts: 22
Joined: October 15th, 2004, 9:18 am

Hide various menu/context options

Post by andrew_wrobel »

I was wondering if there is a way, using userChrome.css, to hide the various menu and context options?

Specificially the following:

Send Link...
Save Page As...
Import...
Work Offline

I've been able to hide the Preferences, Open File and View Page Source options. But no luck with the others.
User avatar
the-edmeister
Posts: 32249
Joined: February 25th, 2003, 12:51 am
Location: Chicago, IL, USA

Re: Hide various menu/context options

Post by the-edmeister »

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

Code: Select all

/* Context menu items to be hidden */
#context-reload,
#context-undo,
#context-copylink,
#context-forward,
#context-back,
#context-cut,
#context-copy,
#context-paste,
#context-delete,
#context-stop,
#context-blockimage,
#context-showimage,
#context-sendimage,
#context-copyimage,
#context-copyimage-contents,
#context-selectall,
#context-bookmarklink,
#context-sendlink,
#context-sendpage,
#context-openlink,
#context-openlinkintab,
#context-searchselect,
#context-keyworkfield,
#context-bookmarkpage,
#context-viewbgimage,
#context-setDesktopBackground,
#context-bidi-text-direction-toggle,
#context-bidi-page-direction-toggle,
#context-sep-bidi,
#spell-check-enabled,
#spell-dictionaries,
#spell-add-dictionaries-main,
#context-viewinfo
{
display: none !important;
}

Just eliminate or comment out the items that you don't want hidden.

As far as Menus other than the Context Menu - I don't have the code for those.
.
A mind is a terrible thing to waste. Mine has wandered off and I'm out looking for it.
andrew_wrobel
Posts: 22
Joined: October 15th, 2004, 9:18 am

Re: Hide various menu/context options

Post by andrew_wrobel »

Thanks!! That did the trick for the context menu.
User avatar
the-edmeister
Posts: 32249
Joined: February 25th, 2003, 12:51 am
Location: Chicago, IL, USA

Re: Hide various menu/context options

Post by the-edmeister »

See if this works for Offline.

Code: Select all

#goOfflineMenuitem

I can't seem to be able to locate Import.



Ed
A mind is a terrible thing to waste. Mine has wandered off and I'm out looking for it.
andrew_wrobel
Posts: 22
Joined: October 15th, 2004, 9:18 am

Re: Hide various menu/context options

Post by andrew_wrobel »

Yes, that did work for Offline.

This is more cluggy, but it works too

menuitem[label="Work Offline"]

Haven't had any luck getting rid of Import or the Save Page As options under file.
andrew_wrobel
Posts: 22
Joined: October 15th, 2004, 9:18 am

Re: Hide various menu/context options

Post by andrew_wrobel »

I was able to hid the Save Page As... option using the following:

menuitem[key="key_savePage"]

I found this by taking a look at the browser.xul file in the browser.jar.

Doesn't look there is an easy way to get rid of the Import... menu option, outside of modifying the browser.jar file.

Here's the line for the Import option:

<menuitem label="&import.label;" accesskey="&import.accesskey;" oncommand="BrowserImport();"/>
Post Reply