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

Serve PNG favicon to Safari and SVG favicon to other browsers #1302

Merged
merged 4 commits into from
Jan 20, 2023

Conversation

casey
Copy link
Collaborator

@casey casey commented Jan 20, 2023

One downside of specifying favicons in HTML is that it doesn't work for pages like HTML and SVG inscriptions, where we don't control the HTML. On those pages, the non-SVG favicon, which doesn't adjust to the user's theme, will be displayed.

To work around this, this PR uses user agent sniffing when /favicon.ico is requested to serve a PNG to Safari, and an SVG to all other browsers.

@batcavekid
Copy link
Contributor

Was going to open an issue about no favicon on svgs but looks like this PR will resolve.

@casey casey merged commit bf83ee6 into master Jan 20, 2023
@casey casey deleted the favicon-svg branch January 20, 2023 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants