Make Firefox 3 Beta NOT update favicons...

Discussion about official Mozilla Firefox builds
Locked
User avatar
RobertJ
Moderator
Posts: 10880
Joined: October 15th, 2003, 7:40 pm
Location: Chicago IL/Oconomowoc WI

Post by RobertJ »

So far this works [-o<

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.

Image

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

Image

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.

Image


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

Image

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.

.
Last edited by RobertJ on May 3rd, 2008, 11:51 am, edited 1 time in total.
FF 92.0 - TB 78.13 - Mac OSX 10.13.6
Helico
Posts: 115
Joined: September 11th, 2006, 5:44 pm

Post by Helico »

There's something I would like, but I don't think there is a way to do it with the current about:config options available. I don't need my bookmarks file to have favicons/site icons stored in it, I have thousands of bookmarks and the extra storage space used may make things slow. But, when I have lots of tabs open, having the favicons visible is helpful to tell the pages apart and tell which are from the same site. There is no way to do this, correct (other than frequent use of a favicon deleting utility)?
Meol
Posts: 86
Joined: April 5th, 2008, 1:12 am

Post by Meol »

weee you're so persistent Robertj

thanks for finally clarifying that epoch microseconds stuff..i finally started to realize how it was defined - then i found your post :)

edit:
Helico, did you try to disable browser.chrome.favicons only in about:config?
User avatar
scratch
Posts: 4942
Joined: November 6th, 2002, 1:27 am
Location: Massachusetts

Post by scratch »

Robert, did you try those prefs i mentioned earlier in the thread?
a_man
Posts: 7
Joined: May 2nd, 2008, 11:30 am

Post by a_man »

im not having much luck with this howto :(
firstly searching in my sqlite manager doesent work making it complicated, secondly i can only find one entry per page, not one for animated and one for not animated
Meol
Posts: 86
Joined: April 5th, 2008, 1:12 am

Post by Meol »

don't forget to clear your history before, since it mixes in with the real bookmarks, making things messy

i think you only need to look for an animated icon entry if there's such an icon present

a note for the expiration: you can just swap the first digit for a '9' that's probably the year 2525 which should suffice ;)
JulianL
Posts: 60
Joined: May 7th, 2007, 2:06 am

Post by JulianL »

a_man wrote:im not having much luck with this howto :(
firstly searching in my sqlite manager doesent work making it complicated, secondly i can only find one entry per page, not one for animated and one for not animated

Maybe it's just me, but I think that Robert deserves some thanks for putting up that howto post, complete with screenshots, since I'm sure it was more than just a couple of minutes of typing for him to do that for us.

Regarding your second question (re animated/non-animated icons), I haven't tried this yet (I'm really hoping that the Places API will get unpicked enough for favicon picker 2 to get updated in the near future) but it looks to me from Robert's phrase "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 howto 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). I suspect that most sites only supply a static favicon so you shouldn't assume that you're doing it wrong because you only find one favicon for a site.

- Julian
a_man
Posts: 7
Joined: May 2nd, 2008, 11:30 am

Post by a_man »

firsty, yes robert deserves huge thanks for the howto and his dedication, as well as for the original favicon extension, and for the hopefully future ffox3 capable one.

ive tried to edit various entries despite there being just one icon and i just cant get it to work, upon restarting firefox there is no favicon at all, and when i load the page the remote default favicon is loaded. i must be doing something wrong. im gonna look for a different sqlite editor cos the firefox one doesent work too well for me, searching just brings up a lot of error messages. maybe cos im on 64 bit linux, i dont know. will look for a standalone sqlite editor
User avatar
RobertJ
Moderator
Posts: 10880
Joined: October 15th, 2003, 7:40 pm
Location: Chicago IL/Oconomowoc WI

Post by RobertJ »

scratch wrote:Robert, did you try those prefs i mentioned earlier in the thread?

Yes but I didn't want to turn it off. Just substitute a few of my own for some really ugly ones.
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 howto 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.

One of the other things bugging me was why certain favicons on bookmarks didn't go to the default. It turns out it was because they pointed to an old url which had a redirect. For example, I had a bookmark for Firefox Add-ons with this url

https://addons.mozilla.org/firefox/

which redirected to this one

https://addons.mozilla.org/en-US/firefox/

Since the favicon came from the second one the bookmark favicon for the first was never changed. At this point I think I have answered all my questions.

a_man wrote:ive tried to edit various entries despite there being just one icon and i just cant get it to work, upon restarting firefox there is no favicon at all, and when i load the page the remote default favicon is loaded. i must be doing something wrong. im gonna look for a different sqlite editor cos the firefox one doesent work too well for me, searching just brings up a lot of error messages. maybe cos im on 64 bit linux, i dont know. will look for a standalone sqlite editor

Why don't you go to the blog of the add-on author and see if he can help. My experience with add-ons is they are "usually" platform independent.

Note also that after editing a row you need to click on the OK button; hitting enter or return does not work. Also, after clicking on OK you make the editing window disappear by clicking on Cancel.


.
FF 92.0 - TB 78.13 - Mac OSX 10.13.6
John 3:16
Posts: 273
Joined: September 9th, 2006, 2:12 pm

Post by John 3:16 »

I was just referred to this rather lengthy thread when I posted mine a few days ago regarding. Robert, thank you for your effort but I think my situation is a bit different perhaps. First, I have about 100+ bookmarks. Second, I simply wish to *disable* the bookmark favicons as I did in FF 2, which worked when you changed true to false on the browse site icons / favicons options in about:config. Still have that, but doesn't work obviously for many of us in FF 3.

Can anyone clarify on this please? Thanks.
User avatar
scratch
Posts: 4942
Joined: November 6th, 2002, 1:27 am
Location: Massachusetts

Post by scratch »

great work robert! i tried it out and it works fine, and hopefully shouldn't update for 91 years. ;)

it wasn't quite enough for me, though, so i had to take it a step further. to get the old site icon out of the URL bar and the tabs, you can add the following code to userChrome.css:

Code: Select all

image[src*="whatever.com/favicon.ico"] {
  padding-top: 16px;
  background-image: url(whatever.ico);
}
Meol
Posts: 86
Joined: April 5th, 2008, 1:12 am

Post by Meol »

hmm those 16 padding means you're just shoving it aside?

wouldn't display:none work too?
User avatar
scratch
Posts: 4942
Joined: November 6th, 2002, 1:27 am
Location: Massachusetts

Post by scratch »

yes, shoving it aside.

no, display:none would not work. you need to keep the element visible so that your replacement icon shows as its background.
a_man
Posts: 7
Joined: May 2nd, 2008, 11:30 am

Post by a_man »

yay i finally got this working after much messing around with different versions of firefox and sqlite manager :D
however one problem remains, is there a way to attach a permanent favicon to a website that doesent use favicons and thus have no records in moz_favicon table ?

edit: i discovered a problem with remote favicon being loaded in bookmarks toolbar while remote animated favicon was being downloaded for later to return to my chosen local png.got rid of that problem by adding *favicon* to ad-block and now all my icons stay as they are supposed to. this hack is probably not for everyone though and may have unwanted side effects but i havent noticed any so far
User avatar
Scarlettrunner20
Posts: 1016
Joined: February 13th, 2003, 5:06 pm

Post by Scarlettrunner20 »

I just imported my bookmarks from Fx 1.5. I had all favicons blocked in 1.5. My bookmarks were crawling with the little critters when I imported them to 3.0RC1. So, I did the usual in About:config to get rid of them. (browser.chrome.favicons;false, browser.chrome.site_icons;false, browser.chrome.image_icons.max_size modify to 0).

They are now gone from Tree Style Tabs and mostly gone from bookmarks. But I still have ones for Mozilla sites (including this one), Firefox sites, my home site dslreports, Microsoft sites, Time Warner sites (my ISP), and a few odd ones like Speedfan and Softpedia. I want ALL of them gone FOREVER.

How do I make them gone ...all of them ...FOREVER? I want NO favicons from NEW bookmarks either. They are a privacy risk and Mozilla should not make them so hard to get rid of. Besides they are distracting and irritating. I was able to get rid of them in Fx 1.5 and 2 easily. So, why is it so difficult in 3?

I also just noticed that History is literally crawling with Favicons. So, how do I get them gone there? Those are all new ones not ones "magically" stuck on my bookmarks import from 1.5 against my desire. You'd think that Fx3 would be polite enough to not add favicons when I had none in 1.5 bookmarks. It should know I don't want any! That should be obvious and it should not have barfed favicons all over my imported bookmarks.

So, do I have to download this "sqlite manager" mentioned on the first page of this thread and mess around in some complicated table just to get rid of something that should not have happened in the first place? And that won't get rid of the ones in history will it?
Locked