My Firefox bookmark toolbar items change icons every now and then for apparently no reason, especially if a site is down. I get the DNS site's icons all over, on another case I have the Facebook icon on a TOTALLY irrelevant bookmark, so the question is: How can I change the icons on my bookmarks in the bookmark toolbar?
7 Answers
Favicon Picker 2 adds a UI for replacing bookmark icons. The extension is based on the the version posted in MozillaZine. It also features an increased icon size limit.
-
Not updated since June 5, 2011 and hasn't worked with Firefox for a while now. Commented Sep 11, 2017 at 22:54
-
2Favicon Picker 3 is not compatible to Firefox Quantum and there is no Favicon Picker 4, yet.– StefanCommented Apr 9, 2018 at 8:18
-
1
-
-
favicon-switcher seems to work only for the icons shown in open tabs, not the ones used for bookmarks. Commented Jul 12, 2023 at 14:06
Point your bookmark at a local HTML document that immediately redirects to the desired destination. Link to a local favicon in the same directory.
You may need to restart your browser before the favicon will show up on the bookmark.
file:///[path]/example.html
<html>
<head>
<meta http-equiv="refresh" content="0; url=http://www.example.com" />
<link rel="shortcut icon" href="example.ico" type="image/x-icon" />
</head>
<body></body>
</html>
file:///[path]/example.ico
This solution suits my personal needs in Firefox 47.0. Note that the solution doesn't work so well where:
- You need to create such bookmarks frequently.
- You have disabled redirection as a security precaution.
- The bookmark must point directly at the destination.
-
1Unfortunately, this solution no longer seems to work as of Firefox 115. I always get the default globe icon for the bookmark. Commented Jul 12, 2023 at 14:14
The following article describes how to do it manually/without extra extension and using a css file in the firefox profile folder (did not test it yet)
- Open up Firefox’s behind-the-scenes “profile” folder on your computer. On Windows 7/8, this is located at:
C:\Users\Your_Username\AppData\Roaming\Mozilla\Firefox\Profiles\Your_Profile_Folder
In that folder, create a new directory called “chrome”, if it doesn’t already exist.
Inside the “chrome” folder, create a new file called “userChrome.css”.
Open up userChrome.css and paste the following CSS code:
/* First line of userChrome.css must be this: */
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/* Custom favicon for this bookmark */
.bookmark-item[label="BOOKMARK_NAME_HERE"] image {
width:0!important;
height:0!important;
padding: 0 0 16px 16px !important;
background:url(BASE_64_STRING_HERE)!important;
}
-
1An easier way to open the profile (which also works on non windows machine) is to enter about:profiles in the url bar of Firefox then open the active profile from there (e.g. on macOS "Show in finder"). Unfortunately I couldn't figure out the CSS part with Firefox 109.– paaatCommented Dec 28, 2022 at 7:43
-
@paaat It's a little late now, but I was able to figure out the correct CSS with Firefox 117 and posted a new answer to this with the latest steps. Commented Sep 11, 2023 at 19:48
Building inspiration on top of Stefan's answer which seems to have become broken between 2018 when it was posted, and now in 2023 in Firefox version 117, I've come up with a solution that is working for me in v117 and will probably be stable until Mozilla decides to stop supporting userChrome.css
. The steps are:
- Enable Firefox user chrome in your about:config and create your userChrome.css file
- Convert the custom image you want to use into base64. You can use a web tool such as base64.guru, or on Linux systems the command
base64
should already be installed so you can run a command like this (replacing the filenames and extension to match yours)
On macOS the command will be:base64 -w0 YOUR_IMAGE_FILE.png > YOUR_ENCODED_IMAGE.txt
Keep in mind that if you have aopenssl base64 -in YOUR_IMAGE_FILE.png -out YOUR_ENCODED_IMAGE.txt
.ico
file, this will not work inuserChrome.css
because that image type is not allowed in CSS styles. You'll need a png, svg, jpg, or other supported image type for this. - In your
userChrome.css
file created in the first step, add the following CSS. Note that there should not be a@namespace url()
at the top of your file; That@namespace
directive is now obsolete and will likely break things./* This code replaces the icon by finding it via URL. Replace the * image="..." part with label="EXACT BOOKMARK LABEL" if you'd * prefer. The URL in this example is the entire thing exactly as * it exists in your bookmark, so it includes the scheme such as * http:// or https:// if that's part of your bookmark. */ .bookmark-item[image="page-icon:FULL_BOOKMARK_URL"] .toolbarbutton-icon { display: none; } .bookmark-item[image="page-icon:FULL_BOOKMARK_URL"]::before { /* replace image/png with the mime type of your image */ background-image: url(data:image/png;base64,BASE_64_ENCODED_TEXT_FROM_PREVIOUS_STEP); background-size: 18px 18px; background-repeat: no-repeat; box-sizing: border-box; content: ' '; display: flex; height: 18px; width: 18px; margin-inline-end: 4px; }
After this code has been added, you'll need to restart your browser to see the updates. You can do that quickly through the Restart Firefox button on the about:profiles
page. If you want to debug the changes and you're comfortable with using Firefox's developer tools, you can enable them for the browser chrome and see the actual styles being applied to your bookmark.
Bookmark Favicon Changer
Right click at your bookmark (Bookmark menu, Bookmark toolbar, Bookmark sidebar, Bookmark manager); the popup menu with option "Change Favicon", "Reset Favicon", "Remove Favicon" and "Export Favicon" will appear.
File types support are ico, bmp, dib, gif, jpg, jpe, jpeg, jif, jfi, jfif, png, apng, svg (every file types that Firefox or SeaMonkey support including URL).
- To get Bookmark Favicon Changer to work in Firefox 40 go to this link
- Instead of clicking on Free Install select the Mirror for Download link and Download to a folder of your choice
- In the main Menu of Firefox select
File
- Select
Open File
from the drop down menu - Navigate to the place where you downloaded Bookmark Favicon Changer and
open it
You will now find that it is in your add-on extension list
-
1
-
2Link Rot on "this link" - page not found. Using v59 April 2018– SDsolarCommented Apr 5, 2018 at 19:18
Answer for those with some SQL skills:
- Stop Firefox (but first copy paste this as text to your editor)
- Grab your favorite SQLite editor
- Load the favicons.sqlite DB that you will find in your firefox profile.
For each of the problem sites execute:
delete from moz_pages_w_icons where page_url like '%superuser.com%'
- Save the DB
Restart firefox, the icons for the bookmarks will be the default icon (still better than the wrong one), and be restored to the correct icon as soon as you open the bookmark.
Firefox seems to clean off the orphan entries in the join table.
Someone perhaps nixda above writes
To get Bookmark Favicon Changer to work in Firefox 40 go to this link But seeing as how it is off site (off the firefox official list of add-ons) I felt to afraid to install it before realising the I already had it installed. Alas it no longer works in firefox 50.
However, this below https://addons.mozilla.org/en-US/firefox/addon/bookmarks-favicon-images/?src=search is on the Firefox official list of add ons, and, while a little less convenient perhaps than the former, it works on firefox 50.