Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Extracted favicon using "chrome://favicon/size/16@3x/" doesn't load the favicon

I am trying to load the favicon of a different website using chrome favicon API chrome://favicon/size/16@3x/ when loading the page it shows a broken Icon.

Example code:

<img class="img-favicon" alt="icon" src="chrome://favicon/size/16@3x/https://replit.com/~"

Am I missing something what is it that I am doing wrong here? Any help, please.
Thank you so much in advance.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

from my research, you cannot use the chrome favicon API outside of extensions/chrome itself.

If you are building a chrome extension, then you would have to add some custom permissions to the manifest.json described in this post: https://stackoverflow.com/a/48304708

If you were looking to grab favicons in a regular website, there exists some websites that offer APIs etc which you can use to get the favicon link, such as this: https://favicongrabber.com/service-api-reference

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading