Search code examples
htmlreactjsmaterial-uifavicon

Default React Favicon shows up on pdf view instead of customized one


I have the following file structure in my React App - public folder:

enter image description here

So my custom favicon that I added(instead of the default React one that I deleted) is working fine, it shows up. Now when the pdf opens in the browser it shows the React favicon.

I read here that the pdf is not a regular html page, so the favicon is not defined as it could be. The fallback is the favicon with the .ico extension in my public folder.

But if thats the case then it should show my favicon that is already in the public folder?

The pdf is linked this way, I use the Link Mui component:

<Link
href="/documents/Privacy-Policy"
target="_blank"
rel="noopener noreferrer">
Privacy Policy
</Link>

What can I do so my favicon or at least no favicon shows up?


Solution

  • Update

    In production it shows no favicon on Chrome and Firefox. While on localhost it still shows the default React favicon on Chrome and Firefox.

    Best case would be to have also my favicon when I open the pdf in Browser but no favicon is good enough for me.