How can I remove items from right-click context menu?

Discussion of features in Mozilla Firefox
Locked
Ashamanic
Posts: 331
Joined: March 28th, 2004, 3:51 am

Post by Ashamanic »

I just tried some of that and my bookmarks folders on the toolbar dissapeared along with th chrome edit icon. Anyone know what I should do to get them back? I removed the changes I made
Found it. They had been moved back to the bookamarks toolbar and were only visible there when I was customizing
Luftpost
Posts: 460
Joined: October 11th, 2003, 7:54 am

Post by Luftpost »

Is this in the FAQ tips and tricks. Should be if it isn't.
User avatar
Morlock
Posts: 191
Joined: July 28th, 2003, 8:02 am

Post by Morlock »

I have a couple of stubborn items in my context menu that I can't get rid of.

In the link context-menu:
Open Link in New Tab
Save Link to Disk

Here's what I have in my userChrome.css file:

/* =============== Context Menu Options Removal */

/* To show item place /* in front of it (see below) */

/* =============== Remove Items In Context Menu: WEB PAGE */
#context-back, /* "Back" */
#context-forward, /* "Forward" */
#context-reload, /* "Reload" */
#context-stop, /* "Stop" */
#context-sep-stop, /* Separator Below "Stop" */
#context-bookmarkpage, /* "Bookmark This Page..." */
#context-savepage, /* "Save Page As..." */
#context-sendpage, /* "Send Page..." */
/* =============== Remove Items In Context Menu: LINKS */
/* Open Link in New Window */
#context-openlink, /* "Open Link in New Window" */
#context-openlinkintab, /* "Open Link in New Tab" */
#context-sep-open, /* Separator Below "Open Link in New..." */
#context-bookmarklink, /* "Bookmark This Link..." */
#context-savelink, /* "Save Link to Disk..." */
#context-sendlink, /* "Send Link..." */
/* #context-copylink, /* "Copy Link Location" */
/* #context-copyemail, /* "Copy Email Address" */
/* #context-sep-copylink, /* Separator Below Link Items */
/* =============== Remove Items In Context Menu: IMAGES */
#context-viewimage, /* "View Image" */
/* #context-copyimage, /* "Copy Image Location" */
#context-copyimage-contents, /* "Copy Image to Clipboard" */
#context-sep-copyimage, /* Separator Below "Copy Image location" */
/* #context-saveimage, /* "Save Image As..." */
#context-sendimage, /* "Send Image..." */
#context-setWallpaper, /* "Set As Wallpaper" */
#context-blockimage, /* "Block Images from this Server" */
#context-sep-viewbgimage, /* Separator Above "View Background Image" */
#context-viewbgimage, /* "View Background Image" */
/* =============== Remove Items In Context Menu: TEXT */
/* #context-undo, /* "Undo" */
/* #context-sep-undo, /* Separator Below "Undo" */
/* #context-cut, /* "Cut" */
/* #context-copy, /* "Copy" */
/* #context-paste, /* "Paste" */
#context-delete, /* "Delete" */
/* #context-sep-paste, /* "Separator Below "Delete" */
/* #context-selectall, /* "Select All" */
#context-sep-selectall, /* "Separator Below "Select All" */
#context-searchselect, /* "Web Search for..." */
/* #context-viewpartialsource-selection, /* "View Selection Source" */
/* =============== Remove Items In Context Menu: EXTRA */
#frame-sep, /* Separator Above "This Frame" */
/* #frame, /* "This Frame" */
#context-viewpartialsource-mathml, /* "View MathML Source" */
#context-sep-properties, /* Separator Above Properties Items */
#context-viewsource, /* "View Page Source" */
#context-viewinfo, /* "View Page Info" */
#context-metadata /* "Properties" */
{ display: none; !important; }

/* =============== Remove Items In Context Menu: BOOKMARKS */
#bookmarks-context-menu menuitem[label="Expand"],
#bookmarks-context-menu menuitem[label="Open"],
#bookmarks-context-menu menuitem[label="Open in Tabs"],
/* #bookmarks-context-menu menuitem[label="Manage Folder"] + menuseparator, */
#bookmarks-context-menu menuitem[label="New Folder..."] + menuseparator,
#bookmarks-context-menu menuitem[label="Open in New Window"],
#bookmarks-context-menu menuitem[label="Open in New Tab"],
#bookmarks-context-menu menuitem[label="Open in New Tab"] + menuseparator,
#bookmarks-context-menu menuitem[label="Cut"],
#bookmarks-context-menu menuitem[label="Copy"],
#bookmarks-context-menu menuitem[label="Paste"],
#bookmarks-context-menu menuitem[label="Paste"] + menuseparator
{ display: none; }

/* =============== End Context Menu Options Removal */
User avatar
soccer_dude182
Posts: 720
Joined: July 11th, 2003, 10:50 pm
Location: Waco, TX

Post by soccer_dude182 »

Whoa, with all that, it's hard to imagine you still have a context menu ;)
Anyway, this is what I have in my userchrome.css to remove open link in new tab (which is basically the same as yours) and it works fine with me. I'm not sure why it's not working with you though...

/* Open Link in New Tab */
#context-openlinkintab
{ display: none !important; }
User avatar
nexx
Posts: 736
Joined: July 29th, 2003, 1:23 am
Location: Brisbane, Australia
Contact:

Post by nexx »

This list is old an there are some items missing which i never filled in, but i hope this helps:

Image
<a href="http://users.bigpond.net.au/nexx1/oxpmenu/" title="Office XP Menus">Office XP Menus</a> || <a href="http://scragz.com/tech/mozilla/firefox-unofficial-branding.php"> Unofficial Firefox Branding</a>
User avatar
mai9
Posts: 1619
Joined: January 15th, 2003, 3:41 pm
Location: Barcelona
Contact:

Post by mai9 »

the "This frame" menus and separator are:

#frame-sep, /* Separator Above "This Frame" */
/* #frame, /* "This Frame" */




that image also lacks "context-sep-paste"

http://lxr.mozilla.org/mozilla/source/b ... er.js#2954
AesirKoki
Posts: 2
Joined: May 8th, 2004, 6:10 am

here's my userChrome.css

Post by AesirKoki »

#context-back,
#context-bookmarklink,
#context-bookmarkpage,
#context-forward,
#context-openlinkintab,
#context-openlink,
#context-reload,
#context-savepage,
#context-selectall,
#context-stop,
#context-setWallpaper,
#context-viewbgimage,
#context-viewimage,
#context-viewinfo,
#context-viewsource,
#context-sendpage,
#context-sendlink,
#context-sendimage,
#context-savelink,
#context-sep-open,
#context-sep-copylink,
#context-sep-stop,
#context-sep-properties,
#context-sep-viewbgimage,
#context-blockimage,
#frame-sep
{
display: none !important;
}
User avatar
thenightfly42
Posts: 983
Joined: November 5th, 2002, 8:03 am

Post by thenightfly42 »

Thanks for everyone's help above. It took me a while, but I finally got it working properly.

There's a new context menu item, "Print...", to remove it use:
#context-printpage
mdinaz
Posts: 7
Joined: May 21st, 2004, 3:24 pm
Location: Arizona

Post by mdinaz »

None of these changes are working for me - perhaps my userChrome.css file is in the wrong directory. What is the
proper directory for this file to be in?

thanks

mc
User avatar
mai9
Posts: 1619
Joined: January 15th, 2003, 3:41 pm
Location: Barcelona
Contact:

Post by mai9 »

the practical way is this extension:

http://extensionroom.mozdev.org/more-info/chromedit
mdinaz
Posts: 7
Joined: May 21st, 2004, 3:24 pm
Location: Arizona

Post by mdinaz »

That worked out great - thanks!

mc
User avatar
mai9
Posts: 1619
Joined: January 15th, 2003, 3:41 pm
Location: Barcelona
Contact:

Post by mai9 »

\:D/
User avatar
ezervoud
Posts: 261
Joined: November 5th, 2003, 2:17 am
Location: Athens

Post by ezervoud »

Can we use the same method to add an item to the context menu?
What I'm looking at is to add "Character encoding" on my right-click options

TIA
plien69
Posts: 333
Joined: November 16th, 2003, 9:19 pm
Location: Fairfield, CT USA

Post by plien69 »

ezervoud,

No, you can't use the same method to add items. This method to remove items basically tells the browser to hide the menu items. The functionality is still there, just hidden. In order to add items to a menu, it has to be coded for somewhere, either in an extension or in the core of the browser itself.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061222 BonEcho/2.0.0.1 (tete009 SSE PGO)
User avatar
ezervoud
Posts: 261
Joined: November 5th, 2003, 2:17 am
Location: Athens

Post by ezervoud »

Thanks plien69!
Locked