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

Discussion of features in Mozilla Firefox
Locked
User avatar
mai9
Posts: 1619
Joined: January 15th, 2003, 3:41 pm
Location: Barcelona
Contact:

Post by mai9 »

wig_out_on_me wrote:/* this is a proper comment */
It should not be
/* this is an /* improper comment */
You could fix the improper one in several ways
/* this is a */ /* proper comment though it is rather silly */
/* this is a proper comment and well formatted */

I use the improper comment and works :-k

Clint1 wrote:I call it "adding something" when the right click menu will not have an item, then you can go into the userChrome file and comment the tag to enable it, then you do have it in the right click menu. To me, that's "adding an item", if that's an erroneous description then I apologize.

let's see, the context menu has by default a fixed number of items, then, via userchrome.css you can remove the ones you don't like. And I call that "removing an item". This is the way, the other way is not correct. It's a concept, but we need to have concepts correctly understood.

#context-viewimage, /* "View Image" */
#context-copyimage /* "Copy Image Location" */
{ display: none; !important; }

this code in userchrome.css removes view and copy image items. If you don't put that code in userchrome (or comment it), then FF does not remove those items.


The only way to add items in the context menu (that I am aware) is installing an extension, but this is not what we're doing in this topic.
User avatar
mai9
Posts: 1619
Joined: January 15th, 2003, 3:41 pm
Location: Barcelona
Contact:

Post by mai9 »

Clint1 wrote:Can anyone tell me please how to remove what I mentioned earlier (the "print preview" and "print" now showing on the context menu EVERYWHERE).
Thanks.

That is a beautiful photo. Is that from a digicam or 35mm?


#context-printpage { display: none; !important; }

I remove the print item with this code.

the photo is from a digicam, and not photoshopped eh! :P
Clint1
Posts: 177
Joined: October 15th, 2004, 6:19 am
Location: Baton Rouge, LA USA

Post by Clint1 »

guiro_boy wrote:
Clint wrote:Ok, I'll give up on descriptions of the css file and what can be done with it. Wink I call it "adding something" when the right click menu will not have an item, then you can go into the userChrome file and comment the tag to enable it, then you do have it in the right click menu. To me, that's "adding an item", if that's an erroneous description then I apologize.


What a semantic mess. I think the point was that you can't use these settings to add options that the Firefox context menus didn't originally contain. The example userChrome configs that people have been posting show how to remove the various default items from the context menu. By commenting out the lines that remove the default items, you are able to restore them to the menu -- i.e. the same effect you could achieve by not including the lines to remove them in the first place. This isn't the same thing as adding a new item which wasn't originally present in Firefox's default context menus, which is what people are trying to explain isn't possible (except through extensions).

I hope that makes sense (and that my understanding of this is correct).

Yes, I got that now, and that makes sense. I didn't realize this as first...maybe the first couple of days, but since then I gathered that. This was one of the things that was confusing as first. But what made it more confusing was that I asked something like "..where can one see a FULL list of what can be in the userChrome.css file..." and someone replied with something like "....there are too many of them" or "the css file would be to large....", etc. This lead me to believe that there were perhaps several dozen more "lines" that could be added to the userChrome file giving it further functionality. I know that functionality would be to remove items now, but nevertheless it would still be more functionality.
Actually, the one thing that I'd actually like to see added to the context menus is an option to switch encodings, which is in the context menus in IE. I browse Japanese sites often and it's useful to have this option close at hand for the rare occasions when the encoding type isn't autodetected properly.

Yes, that would be nice too, and it's good to see a plugin for it. I have to go to a lot of .cn, .tw, .jp, etc., sites myself for PC hardware when there are no USA equivalents.

BTW, I found a problem with the MAF extension (that enables you to save webpages like IE's .mht format). Go to the Mozilla (of all places!) website that shows as the default homepage for FF. Click that T-Shirt at the right, and on the next page the image of the T-Shirt and credit cards disappears!!! I duplicated the error many times by removing the extension and adding it again. It's definitely what's causing it. Strange thing is I haven't noticed this happening at any other websites, just the Mozilla page. Hey, I just now went there again and they removed the T-Shirt image! http://www.mozilla.org/products/firefox/ They now have a NY Times image in its place, but the same thing happens when you click it; the T-Shirt and credit card images on the next page still disappear.
God Bless,
-Clint
Clint1
Posts: 177
Joined: October 15th, 2004, 6:19 am
Location: Baton Rouge, LA USA

Post by Clint1 »

mai9 wrote:
Clint1 wrote:Can anyone tell me please how to remove what I mentioned earlier (the "print preview" and "print" now showing on the context menu EVERYWHERE).
Thanks.

That is a beautiful photo. Is that from a digicam or 35mm?


#context-printpage { display: none; !important; }

I remove the print item with this code.

the photo is from a digicam, and not photoshopped eh! :P

Ok thanks for the line.

Which digicam is that? I have a C-5050 that takes awesome shots, but I already have a dead pixel on it so I have to RMA it. There's a couple of free programs for digicam images that clean up any "noise". One is "DCM" ("Digital camera enhance") and the other is "Neat Image". They both work great.
God Bless,
-Clint
Clint1
Posts: 177
Joined: October 15th, 2004, 6:19 am
Location: Baton Rouge, LA USA

Post by Clint1 »

wig_out_on_me wrote:Clint1 - as a suggestion perhaps just post a simple list of the items you would like to have removed from a standard context menu (e.g. the names and in some cases the part of a web page where you bring up the context menu since they can be different) and perhaps someone can provide the css to place in you userChrome.css with no other css in your userCrhome.css. This will remove any of the potential conflicts due to other modifications that have been made and achieve your goal. To see the standard context menu just rename your userChrome.css to something else and restart firefox. If you have any extensions for modifying the context menu it would probably be best if you either removed the modifications, disabled it, or removed it first as well.

I didn't see this message yesterday. I wasn't getting notifications since my @#$%&!!@ site's server was down therefore my email as well. :2gunfire: :furious: ](*,)

Thanks. At the time it was the "Print" and "Print preview", but I started a new test Profile yesterday and that of course (as I expected) got rid of them. However they will appear again when the culprit extension is installed so I'll need to use that line Mai9 posted ( #context-printpage { display: none; !important; } ). I assume though that line only works for the "Print" and not "Print preview" as well, so I'll need to remove that also from the context.

Does anyone know if all that "default text" in the userChrome file can be removed? This is all of the text you see when you first install "Chrome Edit" and there is no userChrome file. Then after you install it, and before you do anything, the userChrome file is created and has some default items in it. Can this, should this, be removed before doing anything else to it? BTW, I don't have any userChrome.css file until "Chrome Edit" is installed, I assume this is normal behavior.
Thanks.
God Bless,
-Clint
User avatar
mai9
Posts: 1619
Joined: January 15th, 2003, 3:41 pm
Location: Barcelona
Contact:

Post by mai9 »

yes, the default text can be removed.

I don't know about that "print preview" I only noticed a "print" item in my context menu.

the digicam is a nikon 775.
Clint1
Posts: 177
Joined: October 15th, 2004, 6:19 am
Location: Baton Rouge, LA USA

Post by Clint1 »

Thanks. ;)
God Bless,
-Clint
User avatar
ankh
Posts: 503
Joined: November 8th, 2003, 6:09 pm

Post by ankh »

A summary of this thread would seem to me appropriate for the Help menu, or somewhere else people can find it -- unless there's going to be a Contextual Menu item called "Edit_This_List" eventually.
MassMan
Posts: 17
Joined: April 14th, 2004, 5:51 pm

Post by MassMan »

Yes I really can't understand why there's no list over all the "hidden" settings you can change. It's kinda weird you have to go to some forum to figure out how to change relatively simple things.

What's the code for "Copy Image", not the copy image url, but the new that copy the picture it self? #context-saveimage isn't it?
User avatar
mai9
Posts: 1619
Joined: January 15th, 2003, 3:41 pm
Location: Barcelona
Contact:

Post by mai9 »

these are the ones I have for images:

Code: Select all

/* =============== 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" */


I remove all but "save image as"
User avatar
McLaren
Posts: 150
Joined: August 12th, 2003, 11:07 am

Post by McLaren »

tag for future reference
User avatar
mai9
Posts: 1619
Joined: January 15th, 2003, 3:41 pm
Location: Barcelona
Contact:

Post by mai9 »

I suggest you tag this other for future reference:

http://forum.addonsmirror.net/index.php?showforum=8

I am filling it with all this code into categories:

http://forum.addonsmirror.net/index.php?showtopic=96
Last edited by mai9 on June 24th, 2007, 2:47 am, edited 1 time in total.
rotero
Posts: 3
Joined: December 1st, 2004, 8:25 am
Location: Brighton, MA, USA

Post by rotero »

I haven't been able to find (in this thread or other resources) where the attributes for the contextual menus for tabs are stored. I would like to reorder the items in the menu to be more like the order in Mozilla. I used Mozilla for so long before switching to Firefox that I expect "Close Tab" to be the first item in the menu rather than "New Tab." And it just seems a whole lot more intuitive that way.

Any help would be appreciated. If it matters, I'm using Firefox 1.0 on Mac OS X 10.3.6.
IdoMcFly
Posts: 382
Joined: November 3rd, 2003, 1:06 am

Post by IdoMcFly »

I have this line in userChrome.css :

Code: Select all

#openintabs-menuseparator, #openintabs-menuitem { display: none !important; }


but I still have the Open In Tabs entry in the bookmark menu (the one you get when you click on a bookmark directory from the bookmark toolbar folder)

Someone have an idea on what I missed ?
The Q
Posts: 359
Joined: November 14th, 2002, 7:53 am
Location: Sydney, Australia

Post by The Q »

mai9 wrote:I suggest you tag this other for future reference:

http://www.extensionsmirror.nl/index.php?showforum=8

I am filling it with all this code into categories:

http://www.extensionsmirror.nl/index.php?showtopic=96

Outstanding work!
Get my current Proxomitron filters and Firefox CSS files here.
Locked