Skip to content

Add External Favicon Preloading Logic #2

@princefishthrower

Description

@princefishthrower

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    hacktoberfestIssue designated for Hacktoberfest

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions