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

Add External Favicon Preloading Logic #2

Open
princefishthrower opened this issue Sep 30, 2021 · 0 comments
Open

Add External Favicon Preloading Logic #2

princefishthrower opened this issue Sep 30, 2021 · 0 comments
Labels
hacktoberfest Issue designated for Hacktoberfest

Comments

@princefishthrower
Copy link
Owner

princefishthrower commented Sep 30, 2021

Within the usePleaseStay source code there is a TODO to add preload logic for external favicons. You may notice when opting to take external favicons, the favicons sometimes take a moment to appear when being swapped, as they are loaded directly from the URL, and not a local asset.

To fix this, the following should be possible:

  • On hook mount, for each external favicon provided, the favicon should be 'downloaded' and stored somehow
    • perhaps in LocalStorage
    • perhaps in a cookie
    • perhaps even appended and hidden into the DOM somewhere - though this wouldn't work as well for static sites with multiple pages)
    • note this requires determining in the first place if the favicon is external - a regex may do nicely here

I'm open to any options, as long as it gets the job done and is not overly complex!

@princefishthrower princefishthrower added the hacktoberfest Issue designated for Hacktoberfest label Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Issue designated for Hacktoberfest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant