Languages

JavaScript - how to get favicon from website?

0 points
Asked by:
Maison-Humphries
791

How can I get a favicon from a website?

I want to download e.g. YouTube favicon and I don't know how. Can you help me with that? 

1 answer
0 points
Answered by:
Admin Dirask Community
4380

You can use Google Gstatic service.

Solution

1. Go to the following url:

https://t0.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=http://youtube.com&size=16

2. Then right-click the icon and Save image as...

Note:

You can modify the icon size from the url, changing size=16 to e.g. size=32.

Alternative solution

As an alternative you can use DuckDuckGo:

https://icons.duckduckgo.com/ip2/www.youtube.com.ico

 

Practical example

In this example, we present how to get the favicon using src attribute.

0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join