MozillaZine

Is there any way to customize this menu option?

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

Post Posted January 21st, 2018, 11:46 am

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.

Frank Lion

User avatar
 
Posts: 19741
Joined: April 23rd, 2004, 6:59 pm
Location: ... The Exorcist....United Kingdom

Post Posted January 21st, 2018, 12:29 pm

Tushman wrote: I'm just asking if it's possible to do and the directions for it. Thanks.


Yes and .css
Metal Lion latest SeaMonkey & Thunderbird Themes - Sea Monkey and Silver Sea Monkey
"The only thing necessary for the triumph of evil, is for good men to do nothing." - Edmund Burke (attrib.)

Tushman
 
Posts: 116
Joined: May 4th, 2005, 7:50 pm

Post Posted January 21st, 2018, 2:49 pm

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.

BuddhaNature

User avatar
 
Posts: 200
Joined: January 3rd, 2008, 9:44 am
Location: Scotland

Post Posted January 22nd, 2018, 5:31 am

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.

BuddhaNature

User avatar
 
Posts: 200
Joined: January 3rd, 2008, 9:44 am
Location: Scotland

Post Posted January 22nd, 2018, 6:50 am

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.

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

Post Posted January 22nd, 2018, 7:10 am

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;
}

BuddhaNature

User avatar
 
Posts: 200
Joined: January 3rd, 2008, 9:44 am
Location: Scotland

Post Posted January 22nd, 2018, 7:17 am

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.

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

Post Posted January 22nd, 2018, 7:40 am

@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/Web/CSS/Reference#Selectors
http://developer.mozilla.org/en-US/docs/Web/CSS/Adjacent_sibling_selectors

BuddhaNature

User avatar
 
Posts: 200
Joined: January 3rd, 2008, 9:44 am
Location: Scotland

Post Posted January 22nd, 2018, 7:47 am

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.

Tushman
 
Posts: 116
Joined: May 4th, 2005, 7:50 pm

Post Posted January 22nd, 2018, 7:14 pm

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;
}

LIMPET235
Moderator

User avatar
 
Posts: 37973
Joined: October 19th, 2007, 1:53 am
Location: The South Coast of N.S.W. Oz.

Post Posted January 23rd, 2018, 12:35 am

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-7-HP/Intel® DualCore-2.0GHz/500G HDD/4 Gig Ram/550Watt PSU/350WattUPS/Firefox-20.0-56.0.1-57.0/T-bird-2.0.0.24/SnagIt-v10.0.1/MWP-7.11.0.
RadioYachting. (Always choose the "Custom" Install.)

Brummelchen
 
Posts: 3049
Joined: March 19th, 2005, 10:51 am

Post Posted January 23rd, 2018, 1:35 am

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.

BuddhaNature

User avatar
 
Posts: 200
Joined: January 3rd, 2008, 9:44 am
Location: Scotland

Post Posted January 23rd, 2018, 5:53 am

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.

costark
 
Posts: 268
Joined: July 14th, 2004, 5:03 am

Post Posted January 23rd, 2018, 6:08 am

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?
Firefox 58.0.2 (64) - Win 7-64 Hm Prem - Hm-Stdnt '10 Ofce - ESET EIS - MBAM Prem 3 - SuperAS Pro - Macrium Reflect 7 - Diskeeper Pro 15- EPIM Mail - Secunia PSI 3 - NO Java - Flash - i5 8G Quad

BuddhaNature

User avatar
 
Posts: 200
Joined: January 3rd, 2008, 9:44 am
Location: Scotland

Post Posted January 23rd, 2018, 6:26 am

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.

Return to Firefox Support


Who is online

Users browsing this forum: No registered users and 13 guests