Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Favicon NOT working on Edge

I have a problem with this favicon I generated for a local server php project. It works fine on most browsers (Google Chrome, Mozilla Firefox and Opera) but on Microsoft Edge it doesn't work (It shows the default tab favicon).

I've tried many solutions to this problem like clearing the cache, using image format (.png) instead of icon (.ico), but nothing seemed to work.

Here are the lines of code that I've included in the HTML head:

<link rel="icon" href="<?php echo Yii::$app->request->baseUrl; ?>/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<?php echo Yii::$app->request->baseUrl; ?>/favicon.ico" type="image/x-icon" /> 

Anyone had the same issue and solved it?

like image 394
Ragheb AlKilany Avatar asked Oct 12 '15 13:10

Ragheb AlKilany


People also ask

Why is my favicon not displaying?

When you add a favicon to your site, it may not show up since your browser has 'saved' your site as one without a favicon. You need to clear the cache in your browser or use a different browser.

How do I fix my favicon?

Resetting the page or clearing the cache on your site or browser may be sufficient to fix the issue. If that doesn't work, try other options. Different graphic formats are used to create a favicon, but some of them are not supported by all browsers and their versions. In this case, it is recommended to use .

Why is my favicon not updating?

You will have to delete your cache from your browser, close your browser and reopen it. That should fix it. I don't believe your favicons will get refreshed on your favorites until you revisit that page, and assuming that you had previously cleared your browsers cache.

Is there a way to view the favicon on Microsoft Edge?

It works fine on most browsers (Google Chrome, Mozilla Firefox and Opera) but on Microsoft Edge it doesn't work (It shows the default tab favicon).

Does this favicon for local server PHP project work on Microsoft Edge?

3 I have a problem with this favicon I generated for a local server php project. It works fine on most browsers (Google Chrome, Mozilla Firefox and Opera) but on Microsoft Edge it doesn't work (It shows the default tab favicon).

Why won’t my favicon load on edge?

Oct 25 '19 at 8:10 Relative path, server root etc. is possibly a red-herring. Ultimately if the icon host resolves to a loopback IP address (e.g. 127.0.0.1) Edge/IE11 won't load it. – Martin Connell May 29 '20 at 14:09 Add a comment | 4 You should change the name of your favicon.ico file. Like "myFavicon.ico".

How to add favicons in the favorites Bar?

When you click on the star button in the address bar to save an URL as a favorite, you will have to choose the location as Favorite bar. Once you have done this, go to the settings menu and click on 'Advanced settings'. Toggle the option 'Show favorites bar' to ON and then you will be able to see them with the favicons in the Favorites bar.


2 Answers

For me the problem was that on localhost it never worked in Edge. No matter what I did. It was always fine in Chrome and Firefox. The solution was that it only worked in Edge after I deployed to the webserver.

like image 93
Yster Avatar answered Oct 04 '22 07:10

Yster


There are 2 problems in Edge. Both are avoided when deploying to a web server (that's why it started working in another answers after deploying to a web server). However, you can make it work on localhost, too.

1. Incomplete headers returned from server

It looks like for Edge the web server has to return Cache-Control header for the favicon.

E.g. this value works:

Cache-Control: public, max-age=2592000 

The common web servers probably send that header automatically. However, if you have some custom solution, you have to implement it manually. E.g. in WCF:

WebOperationContext.Current.OutgoingResponse.Headers.Add("Cache-Control", "public, max-age=2592000"); 

2. Edge cannot access localhost because of some Windows security settings

By default, Windows store apps cannot use loopback interface. This seems to affect favicon loading, which is loaded using another means that the web page alone (so, even if the web page works, favicon does not work).

To enable loopback for Edge, run this in PowerShell as Administrator:

CheckNetIsolation LoopbackExempt -a -n="Microsoft.MicrosoftEdge_8wekyb3d8bbwe" 

Edge restart is not needed - after page refresh (F5), the favicon should be loaded.

To disable loopback again:

CheckNetIsolation LoopbackExempt -d -n="Microsoft.MicrosoftEdge_8wekyb3d8bbwe" 

The favicon will be cached in Edge, so it will be still visible.

Other info

If you use HTTPS, it looks like the certificate has to be valid (trusted) for the favicon to show.

like image 37
Milan Laslop Avatar answered Oct 04 '22 09:10

Milan Laslop