Favicon size in FF43+

My extension gets favicons for site using getFaviconURLForPage call and shows them using moz-anno:favicon scheme. As of FF42 this always produce 16x16 icons, but starting FF43 icons for some sites (for example bbc.com) become 32x32. I’ve looked into FF sources and found from getImageURLForResolution function (resource://gre/modules/PlacesUtils.jsm), that I probably should add “#-moz-resolution=16,16” suffix to the url, but has no luck.

Could you please suggest me how to get 16x16 favicons in FF43+ or point to appropriate bug id @bugzilla?

What version are you testing with exactly? A nightly build? The function you mention has been removed recently and in fact the -moz-resolution fragments are no longer being applied. This may have caused the difference you are seeing. This bug may be the one that is affecting you:
https://bug635044.bugzilla.mozilla.org/show_bug.cgi?id=1201796

I’m not sure it should cause 32x32 icons to be returned though. It shouldn’t affect end users, just how large favicons get scaled to 16x16. Maybe getFaviconURLForPage is now getting a large pre-scaled icon URL where previously it was returning a -moz-resolution fragment to give you the 16x16 one? Or just getting the raw .ico file instead of a particular sized icon from it?

Thanks for pointing me to bugzilla, 'll try investigate. I’m currently use aurora/de 43.0a2 20151013004018, several days ago there was a change from 16x16 to 32x32 icon size, can’t specify exact build. The nightly return 32x32 as well, but release and beta - 16x16. I also want to note that not only getFaviconURLForPage started provide 32x32, but nsIBrowserSearchService getEngineByName().iconURI.spec too.

Thank you once again, I figured out that bug 1201796 is definitely a reason for such behavior.

I’m interested in just what is happening here, since I use this code in one of my addons. I thought I had a recent nightly version, but turns out it is from August. I’ll download a new one and see what is going on.

So I got the latest nightly. Bad idea, all sorts of stuff broke. Anyway, finally got some favicon code working and it is fine for me. getFaviconURLForPage happily returns exactly the same URL as before. I don’t think anything has changed with this function.

For bbc.com the favicon is a multi-resolution .ico file. When I download and display it in FF43, it comes out as a 32x32 image. If I do the same in FF38, it comes out as a 16x16 image, but the different behaviour is somewhere other than getFaviconURLForPage.

The decoding of the icon image is now dynamically performed based on the size of the area for which it is being decoded. If you show it alone in a browser window, it picks the biggest version. If you constrain it to a 16x16 button, in theory it should decode the 16x16 icon. I’m not sure how I can test this, since it could equally well be decoding the 32x32 version and downsizing it. Does that sound like what you’re seeing?

Yes, I use favicons in context of background-image of 16x16px div and already got rid of new side effect by simple setting background-size to 100%, but wanted to understand the cause. So, all is clear now, thanks once again.