16

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?

2

7 Answers 7

7

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.

enter image description here

5
  • Not updated since June 5, 2011 and hasn't worked with Firefox for a while now. Commented Sep 11, 2017 at 22:54
  • 2
    Favicon Picker 3 is not compatible to Firefox Quantum and there is no Favicon Picker 4, yet.
    – Stefan
    Commented Apr 9, 2018 at 8:18
  • 1
    No alternatives known, yet
    – jalanb
    Commented May 9, 2018 at 19:27
  • 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
13

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.
1
  • 1
    Unfortunately, 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
4

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)

http://www.tersetechtips.com/how-to-change-firefox-bookmark-icons-favicons-without-extensions-or-addons/

  1. 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

  1. In that folder, create a new directory called “chrome”, if it doesn’t already exist.

  2. Inside the “chrome” folder, create a new file called “userChrome.css”.

  3. 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; 
}
2
  • 1
    An 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.
    – paaat
    Commented 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
4

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:

  1. Enable Firefox user chrome in your about:config and create your userChrome.css file
  2. 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)
    base64 -w0 YOUR_IMAGE_FILE.png > YOUR_ENCODED_IMAGE.txt
    
    On macOS the command will be:
    openssl base64 -in YOUR_IMAGE_FILE.png -out YOUR_ENCODED_IMAGE.txt
    
    Keep in mind that if you have a .ico file, this will not work in userChrome.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.
  3. 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.

3

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).

enter image description here

  1. To get Bookmark Favicon Changer to work in Firefox 40 go to this link
  2. Instead of clicking on Free Install select the Mirror for Download link and Download to a folder of your choice
  3. In the main Menu of Firefox select File
  4. Select Open File from the drop down menu
  5. 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

2
  • 1
    Not compatible with Firefox Quantum. Commented Feb 21, 2018 at 14:47
  • 2
    Link Rot on "this link" - page not found. Using v59 April 2018
    – SDsolar
    Commented Apr 5, 2018 at 19:18
2

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.

0

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.

2
  • Went there and it says it is not compatible with Quantum.
    – SDsolar
    Commented Apr 5, 2018 at 19:19
  • add on not available anymore
    – Honeybear
    Commented Apr 10 at 8:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .