X
點擊此處開啟此網站的行動版。

技術支援討論區

Is it possible to have different icon for differnt folders in bookmark toolbar

已張貼

On the bookmarks toolbar all folders have the same icon. Is there a way to assign different icons to different folders. Even if customizing requires programming is not a problem. If this is possible can someone point me in the right direction. Thank you in advance, Momir

On the bookmarks toolbar all folders have the same icon. Is there a way to assign different icons to different folders. Even if customizing requires programming is not a problem. If this is possible can someone point me in the right direction. Thank you in advance, Momir

額外的系統細節

已安裝的外掛程式

  • Adobe PDF Plug-In For Firefox and Netscape 10.1.2
  • A plugin to detect whether the Adobe Application Manager is installed on this machine.
  • Google Update
  • HP Active Check Plugin
  • HP Pit Plugin
  • HP Product Detection Plugin
  • NPRuntime Script Plug-in Library for Java(TM) Deploy
  • Next Generation Java Plug-in 11.45.2 for Mozilla browsers
  • Shockwave Flash 17.0 r0
  • 5.1.20513.0

應用程式

  • User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0

更多資訊

jscher2000
  • Top 10 Contributor
8699 個解決方法 71108 個答案

有幫助的回覆

Hmm, maybe. The Bookmarks Toolbar icons can be restyled using custom CSS rules in a userChrome.css file or the Stylish extension.

For example, I created one that helps me spot bookmarklets by replacing the generic dotted outline with a blue bullet:

@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
#personal-bookmarks .bookmark-item[scheme="javascript"] .toolbarbutton-icon {
  width:6px !important;
  height:6px !important;
  background-color:#00f !important;
  border-radius:3px !important;
}

Targeting individual folders is going to require some fancier selectors, but hopefully will be possible. Also, introducing new icons may require that you convert the the images to data-URIs, since I'm not sure you can use arbitrary URLs with toolbar images.

Not sure if this is enough to get started. Do you have the DOM Inspector extension? It has a feature to inspect the DOM of toolbars, which might be useful.

Hmm, maybe. The Bookmarks Toolbar icons can be restyled using custom CSS rules in a userChrome.css file or the Stylish extension. For example, I created one that helps me spot bookmarklets by replacing the generic dotted outline with a blue bullet: @namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul); #personal-bookmarks .bookmark-item[scheme="javascript"] .toolbarbutton-icon { width:6px !important; height:6px !important; background-color:#00f !important; border-radius:3px !important; } Targeting individual folders is going to require some fancier selectors, but hopefully will be possible. Also, introducing new icons may require that you convert the the images to data-URIs, since I'm not sure you can use arbitrary URLs with toolbar images. Not sure if this is enough to get started. Do you have the DOM Inspector extension? It has a feature to inspect the DOM of toolbars, which might be useful.
jscher2000
  • Top 10 Contributor
8699 個解決方法 71108 個答案

Or perhaps check the Add-ons site first, since there are many bookmark-related extensions.

Or perhaps check the Add-ons site first, since there are many bookmark-related extensions.
cor-el
  • Top 10 Contributor
  • Moderator
17482 個解決方法 157978 個答案

Add code to the userChrome.css file below the default @namespace line.


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

#bookmarksMenuPopup .bookmark-item[container][label^="<folder name>"] {
 list-style-image:url('bookmark-icon.png')!important;
 -moz-image-region:auto!important;
}

The icon file needs to be in the chrome folder where the userChrome.css is located.


The customization files userChrome.css (user interface) and userContent.css (websites) are located in the chrome folder in the Firefox profile folder.

  • Create the chrome folder (lowercase) in the <xxxxxxxx>.default profile folder if this folder doesn't exist
  • Use a plain text editor like Notepad to create a (new) userChrome.css file in the chrome folder (file name is case sensitive)
  • Paste the code in the userChrome.css file in the editor window
  • Make sure that the userChrome.css file starts with the default @namespace line
  • Make sure that you select "All files" and not "Text files" when you save the file via "Save file as" in the text editor as userChrome.css.
    Otherwise Windows may add a hidden .txt file extension and you end up with a not working userChrome.css.txt file

You can use this button to go to the current Firefox profile folder:

Add code to the <b>userChrome.css</b> file below the default @namespace line. *http://kb.mozillazine.org/userChrome.css ---- <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */ #bookmarksMenuPopup .bookmark-item[container][label^="<folder name>"] { list-style-image:url('bookmark-icon.png')!important; -moz-image-region:auto!important; } </nowiki></pre> The icon file needs to be in the chrome folder where the userChrome.css is located. ---- The customization files userChrome.css (user interface) and userContent.css (websites) are located in the <b>chrome</b> folder in the Firefox profile folder. *http://kb.mozillazine.org/Editing_configuration *Create the chrome folder (lowercase) in the <xxxxxxxx>.default profile folder if this folder doesn't exist *Use a plain text editor like Notepad to create a (new) userChrome.css file in the chrome folder (file name is case sensitive) *Paste the code in the userChrome.css file in the editor window *Make sure that the userChrome.css file starts with the default @namespace line *Make sure that you select "All files" and not "Text files" when you save the file via "Save file as" in the text editor as userChrome.css.<br>Otherwise Windows may add a hidden .txt file extension and you end up with a not working userChrome.css.txt file You can use this button to go to the current Firefox profile folder: *Help > Troubleshooting Information > Profile Directory: Show Folder (Linux: Open Directory; Mac: Show in Finder) *http://kb.mozillazine.org/Profile_folder_-_Firefox

提出問題者

jscher2000 said

Not sure if this is enough to get started. Do you have the DOM Inspector extension? It has a feature to inspect the DOM of toolbars, which might be useful.

More I've been thinking about this more i see that it wont be as easy as I hoped. I suppose that i could change using CSS how all folder icons looks, but to change them individual will require accessing each by name. I will try with DOM Inspector. That seems logical to me .

Thank you very much I have ena idea where to start. I will post there if I find sutable solution.

Regards to all

''jscher2000 [[#answer-755525|said]]'' <blockquote> Not sure if this is enough to get started. Do you have the DOM Inspector extension? It has a feature to inspect the DOM of toolbars, which might be useful. </blockquote> More I've been thinking about this more i see that it wont be as easy as I hoped. I suppose that i could change using CSS how all folder icons looks, but to change them individual will require accessing each by name. I will try with DOM Inspector. That seems logical to me . Thank you very much I have ena idea where to start. I will post there if I find sutable solution. Regards to all
Wizardgoat 4 個解決方法 22 個答案

有幫助的回覆

Your problem is now solved! The Bookmarks Folder Images extension will let you either select from a list of icons, or provide your own icons, for any Bookmarks folder. Note that most of the CSS solutions will style only the popups. They cannot readily style individual "tree children" in the Sidebar and Library views. It takes an extension, and this one will do it.

See https://addons.mozilla.org/addon/bookmarks-folder-images/

Your problem is now solved! The Bookmarks Folder Images extension will let you either select from a list of icons, or provide your own icons, for any Bookmarks folder. Note that most of the CSS solutions will style only the popups. They cannot readily style individual "tree children" in the Sidebar and Library views. It takes an extension, and this one will do it. See https://addons.mozilla.org/addon/bookmarks-folder-images/