Is there any way to customize this menu option?

User Help for Mozilla Firefox
Tushman
Posts: 210
Joined: May 4th, 2005, 7:50 pm

Is there any way to customize this menu option?

Post by Tushman »

As the old saying goes, a picture is worth a thousand words.

Image

I'm using v56.0.1 (And please don't preach to me about updating to the latest version. There's a couple of reasons why I'm still on v56.x.). I'm just asking if it's possible to do and the directions for it. Thanks.
User avatar
Frank Lion
Posts: 21177
Joined: April 23rd, 2004, 6:59 pm
Location: ... The Exorcist....United Kingdom
Contact:

Re: Is there any way to customize this menu option?

Post by Frank Lion »

Tushman wrote: I'm just asking if it's possible to do and the directions for it. Thanks.
Yes and .css
"The only thing necessary for the triumph of evil, is for good men to do nothing." - Edmund Burke (attrib.)
.
Tushman
Posts: 210
Joined: May 4th, 2005, 7:50 pm

Re: Is there any way to customize this menu option?

Post by Tushman »

Frank, thanks for the response but that's not very helpful. The only "customization" I know how to do is to install an add-on - that's my extent of skills with firefox. (I am exaggerating a bit but I'm trying to convey here that I'm not a coder, website developer, or a Firefox expert). When i saw your reply, I googled around for a solution. The search results are showing things like "how to customize the context menu" and such. Nothing related to the CSS solution of customizing that menu option I have shown in my screenshot.

#1: CSS = cascading style sheet. OK.... but where i the hell do I find it?

I looked in my user profile:
C:\Users\Tushman\AppData\Roaming\Mozilla\Firefox\Profiles\dr385eto.default-1514828593031
I don't see any CSS files (and before you ask, yes I do have file extension turned on in Windows).

So I started to google around again. It seems like you're referring to the UserChrome.css file? Do I need to create one from scratch and then write the necessary code for it? Since your reply was so short, I have no idea if I am on the right track or not.

#2: If it's possible to do with CSS, Google search would have surely picked up some website that explains it. And yet, I don't see any specific instructions anywhere. I would appreciate a a more specific answer if you can.
User avatar
BuddhaNature
Posts: 537
Joined: January 3rd, 2008, 9:44 am
Location: Scotland

Re: Is there any way to customize this menu option?

Post by BuddhaNature »

Probably you need to create a chrome folder and a userChrome.css file. Step-by-step instructions on how to do this are here: A Beginner's Guide to Creating and Using a userChrome.css File

As to the particular code you are looking for - I don't know.
OS: Windows 10 Pro. x64
User avatar
BuddhaNature
Posts: 537
Joined: January 3rd, 2008, 9:44 am
Location: Scotland

Re: Is there any way to customize this menu option?

Post by BuddhaNature »

I worked out a way to get rid of the Cut and Paste icons. Try this in your userChrome.css file:

Code: Select all

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

#cut-button {
  visibility: hidden !important;
}
#paste-button {
  visibility: hidden !important;
}
I tried this in FF 57 and it works. However, it seems there is padding to the left and right of the remaining 'Copy icon'. I don't see any way to get rid of that padding. The look of it in the bar is that though the cut and paste icons are not displayed there is still space reserved, and displayed, for Cut and Paste icons as if they should be there. (Makes sense. I found a way to hide the icons but not control the space they occupy.)

Maybe Frank Lion knows a way to deal with that right/left space and get rid of it.
OS: Windows 10 Pro. x64
morat
Posts: 6421
Joined: February 3rd, 2009, 6:29 pm

Re: Is there any way to customize this menu option?

Post by morat »

I rather colorful icons than boring black icons...

Code: Select all

/* Firefox userChrome.css */

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

#cut-button,
#cut-button + separator,
#copy-button + separator,
#paste-button {
  display: none !important;
}

#copy-button {
  fill: orange !important;
}
User avatar
BuddhaNature
Posts: 537
Joined: January 3rd, 2008, 9:44 am
Location: Scotland

Re: Is there any way to customize this menu option?

Post by BuddhaNature »

Thanks, morat. Much better than my poke-and-stab attempt. Any chance of commenting the code a bit so as to work out what it's actually doing.
OS: Windows 10 Pro. x64
morat
Posts: 6421
Joined: February 3rd, 2009, 6:29 pm

Re: Is there any way to customize this menu option?

Post by morat »

@BuddhaNature

Sure.

Difference between visibility:hidden and display:none
http://stackoverflow.com/questions/133051

CSS combinators:

Adjacent sibling combinator A + B
General sibling combinator A ~ B
Child combinator A > B
Descendant combinator A B

#cut-button + separator = selector for separator element immediately following toolbarbutton[id="cut-button"] element

CSS Reference
http://developer.mozilla.org/en-US/docs ... #Selectors
http://developer.mozilla.org/en-US/docs ... _selectors
User avatar
BuddhaNature
Posts: 537
Joined: January 3rd, 2008, 9:44 am
Location: Scotland

Re: Is there any way to customize this menu option?

Post by BuddhaNature »

Thanks very much for the links morat. I'm definitely a beginner so what is clear to you is mystery, still, to me. I'll read what you point to when I get more time. Read the stackoverflow link and it makes instant sense. Thanks again.
OS: Windows 10 Pro. x64
Tushman
Posts: 210
Joined: May 4th, 2005, 7:50 pm

Re: Is there any way to customize this menu option?

Post by Tushman »

Wow, i owe a big thank you to both BuddhaNature and morat. That did the trick.

Hey by the way BuddhaNature, I notice that in the link you provided, there are instructions how to change the bookmark folder colors back to yellow like in the previous versions. How do I combine that code along with the code provided in my thread? I tried my hand at it but being such a novice to this whole thing, I could not combine it cprrectly. What am I missing here?

Code: Select all

/* Firefox userChrome.css */

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

#cut-button,
#cut-button + separator,
#copy-button + separator,
#paste-button {
  display: none !important;
}

#copy-button {
  fill: orange !important;
}

/* USE OLD STYLE YELLOW BOOKMARK FOLDERS */

.bookmark-item[container] {
  list-style-image: url("folder-item.png") !important;
  -moz-image-region: rect(0px, 32px, 16px, 16px) !important;
}
User avatar
LIMPET235
Moderator
Posts: 39956
Joined: October 19th, 2007, 1:53 am
Location: The South Coast of N.S.W. Oz.

Re: Is there any way to customize this menu option?

Post by LIMPET235 »

Hi,
I am not a coder but I have done that "bookmark conversion."
I hated the "plain paper variety."
Did you include the "folder-item .png file" into the chrome folder?

From the above post > link...
ref; > (D) Getting the Image File Needed to Work with the CSS Code.
(1) Click on this link: folder-item.png A webpage will open with an image in the page.
(2) Right-click on the image and select "Save image as..."
(3) Download the image to your system. Do not change the name of the file, the CSS script relies on the image file having the title folder-item.png
(4) Now make a copy of the image file into the chrome folder.

It most definitely looks a whole lot better.
[Ancient Amateur Astronomer.]
Win-10-H/64 bit/500G SSD/16 Gig Ram/450Watt PSU/350WattUPS/Firefox-115.0.2/T-bird-115.3.2./SnagIt-v10.0.1/MWP-7.12.125.

(Always choose the "Custom" Install.)
Brummelchen
Posts: 4480
Joined: March 19th, 2005, 10:51 am

Re: Is there any way to customize this menu option?

Post by Brummelchen »

Aris hast some proper code in his collection for the folder item.
https://github.com/aris-t2/customcssforfx

it is not that simple to replace as simple code mess up the ui.
User avatar
BuddhaNature
Posts: 537
Joined: January 3rd, 2008, 9:44 am
Location: Scotland

Re: Is there any way to customize this menu option?

Post by BuddhaNature »

Hi Tushman,

Looking at the code you provide it seems clear that you didn't read the whole guide I pointed to as I did mention a better block of code for dealing with the Bookmarks folder colour. The code that you are using won't change the bookmarks folders when viewing via (Menu) Bookmarks > Show All Bookmarks (Ctrl+Shift+B). There is a block of code is on page 2 of that thread that changes the folders in (Menu) Bookmarks and in Show All Bookmarks. Go back and read the Guide, and the notes that follow it, it will take you less than ten minutes. However, the code you have posted here looks all fine to me and should work (albeit there is better code available).

As Limpet says, it seems likely you didn't download the image file required to get that 'bookmarks' code to work. Go back and read through the guide and it will all become clear what to do. The link to download the image file is in the Guide. Also go to page 2 of that thread and replace the bookmarks code you have with the improved code. You also need the image file for the improved code to work.
OS: Windows 10 Pro. x64
User avatar
costark
Posts: 548
Joined: July 14th, 2004, 5:03 am

Re: Is there any way to customize this menu option?

Post by costark »

Tushman wrote:Wow, i owe a big thank you to both BuddhaNature and morat. That did the trick.

Hey by the way BuddhaNature, I notice that in the link you provided, there are instructions how to change the bookmark folder colors back to yellow like in the previous versions. How do I combine that code along with the code provided in my thread? I tried my hand at it but being such a novice to this whole thing, I could not combine it cprrectly. What am I missing here?

Code: Select all

/* Firefox userChrome.css */

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

#cut-button,
#cut-button + separator,
#copy-button + separator,
#paste-button {
  display: none !important;
}

#copy-button {
  fill: orange !important;
}

/* USE OLD STYLE YELLOW BOOKMARK FOLDERS */

.bookmark-item[container] {
  list-style-image: url("folder-item.png") !important;
  -moz-image-region: rect(0px, 32px, 16px, 16px) !important;
}
Tushman, I have the Old Style BkMk Folder script you have = GOLD Folders BUT do NOT have a SPACE between the title and script (nor does BuddhaNature). Might THAT be the issue?
W10 22H2 - SSD-HDD i5 12G -
User avatar
BuddhaNature
Posts: 537
Joined: January 3rd, 2008, 9:44 am
Location: Scotland

Re: Is there any way to customize this menu option?

Post by BuddhaNature »

No, having a space (blank line) or not having a blank line is not the issue - you are free to have or not have one (or even many) as you please. What you are referring to as the "title" is just a comment-line. Firefox will ignore comment lines when it parses the code. Likewise, Firefox will ignore blank lines when parsing the code. Most likely, as Limpet suggests, Tushman just hasn't put a copy of the required image file inside his chrome folder.

P.S. I have actually tested Tushman's code on my own system and it does what it should do - so long as the image file is in the chrome folder. But again I'd mention that the code Tushman has won't work in both (Menu) Bookmarks and Show All Bookmarks. Improved code will do that though.
OS: Windows 10 Pro. x64
Locked