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] Fetching favicon fails at runtime(404 Error) #2

Open
yashchaudhari008 opened this issue Jan 23, 2024 · 8 comments
Open

[BUG] Fetching favicon fails at runtime(404 Error) #2

yashchaudhari008 opened this issue Jan 23, 2024 · 8 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@yashchaudhari008
Copy link
Owner

yashchaudhari008 commented Jan 23, 2024

Issue: Currently, while fetching the favicon if any error occurs there is no fallback favicon. Also fallback src doesn't work as this fails at runtime

Possible Solution: handle this in onerror attribute of <img /> tag. Also try to use chrome://favicon for fetching favicon.

Image Image
@yashchaudhari008 yashchaudhari008 converted this from a draft issue Jan 23, 2024
@yashchaudhari008 yashchaudhari008 changed the title Favicon fallback (onerror in img tag) Fetching favicon fails at runtime(404 Error) Jan 23, 2024
@yashchaudhari008 yashchaudhari008 changed the title Fetching favicon fails at runtime(404 Error) [BUG] Fetching favicon fails at runtime(404 Error) Jan 23, 2024
@yashchaudhari008 yashchaudhari008 self-assigned this Jan 26, 2024
@yashchaudhari008 yashchaudhari008 added the help wanted Extra attention is needed label Jan 27, 2024
@yashchaudhari008
Copy link
Owner Author

Approach: handling fallbacks in onError
Problem: API used for fetching favicon return fallbacks by itself and therefore onError is never triggered even when we get a 404 response

@yashchaudhari008 yashchaudhari008 moved this from Todo to Blocker in Minime Project Jan 27, 2024
@yashchaudhari008 yashchaudhari008 added the bug Something isn't working label Jan 27, 2024
@yashchaudhari008 yashchaudhari008 removed their assignment Feb 5, 2024
@MRodriguez-M
Copy link
Contributor

Hi, I would like to take a look at this issue too, could you please assign it to me?

@yashchaudhari008
Copy link
Owner Author

@MRodriguez-M you can look for the solution. If you find any, let me know here first

@meetbhalodi11
Copy link

@yashchaudhari008 I would like to try this as I have worked on similar issues in past

@meetbhalodi11
Copy link

@yashchaudhari008 I have tried 1 solution that did not work. The reason is that even if we try to fetch the icon from API, it will be rejected by the servers due to CORS policy.
1, so alternatively we will have to use a backend server to fetch the icon from the server which is I guess not feasible.
2, or we can create a cloud function to fetch the icons and use it in the frontend.

@meetbhalodi11
Copy link

We can also use CORS mask services like this -> https://cors.sh/
They also provide open source quota requests per month

@yashchaudhari008
Copy link
Owner Author

Can you check whether it is possible to get favicons from Chrome cached favicons

@meetbhalodi11
Copy link

Favicon storage varies by OS. Storage path are also different: Link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
Status: Blocker
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants