Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Custom favicon set up in manager-head.html does not show up in Firefox #21458

Open
valentinpalkovic opened this issue Mar 7, 2023 · 5 comments

Comments

@valentinpalkovic
Copy link
Contributor

valentinpalkovic commented Mar 7, 2023

Describe the bug

Custom favicon set up in manager-head.html does not show up in Firefox

To Reproduce

The reporter used this repo: https://github.com/CivicDataLab/opub-mono

  1. Create a .storybook/manager-head.html file and paste the following content to it:
<link rel="shortcut icon" href="https://www.google.com/favicon.ico">
  1. Visit the local Storybook in Firefox. The icon is not shown.

System

No response

Additional context

No response

@yoshi2no
Copy link
Contributor

yoshi2no commented May 1, 2023

It seems that the favicon is shown by giving a value to the sizes attribute in Firefox.

<link rel="shortcut icon" href="https://www.google.com/favicon.ico" sizes="192x192" />

Is this a specific issue with storybook?

@JoshTumath
Copy link

We can reproduce as well in Chrome. In Firefox, the bug only sometimes happens, but normally Firefox will take the icon specified in manager-head over the one defined by Storybook.

The icons are specified in this order in the built index.html file:

<!-- The icon defined by Storybook -->
<link rel="icon" type="image/svg+xml" href="./favicon.svg" />

<!-- Our icons defined in our manager-head.html -->
<link rel="icon" href="images/favicon-16.png" sizes="16x16">
<link rel="icon" href="images/favicon-32.png" sizes="32x32">
<link rel="icon" href="images/favicon-64.png" sizes="64x64">
<link rel="icon" href="images/favicon-192.png" sizes="192x192">

And due to undefined behaviour as to how browsers should work out which icon takes precedence, we're seeing different browsers choose different icons.

@MikeHewett
Copy link

With the latest version of Storybook (7.6.12), I've observed that manager-head.html is no longer honoured / used.

In order to get a custom favicon working, I did the following:

  1. remove manager-head.html (its not used anymore)
  2. Create an svg of your custom icon and name it favicon.svg
  3. put this svg in your public folder - e.g. public/favicon.svg
  4. Run Storybook and observe the icon now reflects your custom one

@James-Wilkinson-git
Copy link

Also have this issue, manager-head is being injected but storybook is injecting its own favion and cant override it

@herzaso
Copy link

herzaso commented Dec 16, 2024

I can't seem to override the default favicon in chrome as well. I'm using a png file and have tried setting it through the link tag in manager-head.html, but running it locally, I don't see the new favicon

<link rel="shortcut icon" href="/favicon.png" type="image/png" sizes="16x16" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants