Favicon requests are made to root path even if an explicit load direction exists




4 years ago
7 months ago


(Reporter: tolisemm, Unassigned)


39 Branch

Firefox Tracking Flags

(Not tracked)




4 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36

Steps to reproduce:

Add the following tag in the HTML header of a site: 
<link rel="icon" type="image/x-icon" href="/myapp/theme/images/favicon.ico">

Open the browser and navigate to the page containing the tag. Then close the browser, reopen it, navigate to the page again and press Ctrl + F5 multiple times.

Actual results:

Firefox creates some requests to the root path, in order to get the favicon.

"GET /favicon.ico HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0" 

Expected results:

According http://www.w3.org/TR/html5/links.html#rel-icon "In the absence of a link with the icon keyword, for Documents obtained over HTTP or HTTPS, user agents may instead attempt to fetch and use an icon with the absolute URL obtained by resolving the URL "/favicon.ico" against the document's address, as if the page had declared that icon using the icon keyword."

So, I believe that when a link with the icon keyword exists in the page, Firefox should not try to get the favicon from the root path


4 years ago
Component: Untriaged → Places
Product: Firefox → Toolkit
Places only stores the favicon as requested by the browser, so the code doing this lives in browser.


I think it may have been done on purpose to try to provide an alternative when the defined icon cannot be loaded (404 or other network error), but I'm not sure, there's not comment in the code regarding that.
Component: Places → Tabbed Browser
Product: Toolkit → Firefox
would you mind checking what IE, Safari and Chrome do with your testcase?

Comment 3

4 years ago
(In reply to Marco Bonardo [::mak] from comment #2)
> would you mind checking what IE, Safari and Chrome do with your testcase?

Thank you for looking this issue.

About my testcase:
In Chrome, I don't see any request in the root path. Always, the address defined in the link tag is being used. Also, I have noticed that every time I refresh the page with Ctrl + F5, Chrome performs a new request to fetch the favicon. On Firefox this does not happen. I have to keep Ctrl + F5 pressed for some time and perform many requests to make it fire the favicon GET request. It seems that Firefox caches the favicon image and does not fetch it on every Ctrl + F5.

Comment 4

7 months ago
This case happens when Firefox load a page from cache.

I wrote <link rel="icon" type="image/x-icon" href="/xxxx/favicon.ico"> in Head element.
But, Firefox tries load favicon.ico from root.
You need to log in before you can comment on or make changes to this bug.