This is the process I used to remove a default favicon, insert a custom favicon and insure it "sticks" (one day and counting).
1 - I installed add-on SQLite Manager.
2 - I then made a copy of places.sqlite
3 - I opened the copy with SQLite Manager
4 - I searched the moz_places table until I found the bookmark I wanted to change. Note that there may be several entries because of history and links within the site. It is best to make your search as broad as possible. In this case the favicon id=377. Caution assuming you have it; more later.
5 - Then search the moz_favicon table using part of the url, again make it broad. You end up with favicons with id=377 and id=721
It turns out this site loads an animated favicon and a static one; both need to be changed.
Code: Select all
<link rel="shortcut icon" href="favicon.ico">
<link rel="icon" href="animated_favicon1.gif" type="image/gif">
6 - Select the row of interest and double click on it. Then click on the paperclip icon next to the BLOB field to load your custom favicon.
7 - Change the mime_type if required, note that a .ico favicon uses mime_type image/x-icon and a png favicon is image/png.
8 - Now set the expiration date. In the figure above I set it to 1241136000000000 which is May 1, 2009. Note: you can add a 365 day year by adding 31536000000000. (Note: times in the places.sqlite tables are in microseconds since 1 Jan 1970, also known as PRTime)
a_man Jan 1, 2099 is 4070908800000000.
9 - Now close the Database under the Database menu, close the SQLite Manager window and quit FF.
10 - Insert the modified places.sqlite file in your profile replacing the current one (you might want to save the current one "just in case").
11 - Restart FF and you should see the custom favicon in your bookmarks and in your history. You will not see it in the URL bar however.
I had thought about developing an add-on to do this using the nsIFaviconService. In the end I decided it was more difficult than it seemed because of multiple favicons for the same domain. For example here is what you find in the moz_places table for my profile for rueters.com (assuming you cleared the history).
The first entry is for www.reuters.com and the second for uk.reuters.com. It would seem like developing a search technique that finds all favicon entries associated with reuters is far from simple.
JulianL wrote:"It turns out this site loads an animated favicon and a static one" that it is just that the site he chose to use for his how to has two different favicons (maybe he chose this to show the most complicated case so people don't get caught out by sites that supply two favicons).
You are correct. Just picked it to demonstrate that a simple search of moz_places can mislead you.
.