EN
JavaScript - how to get favicon from website?
1 answers
0 points
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
You can use Google Gstatic service.
Solution
1. Go to the following url:
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.
xxxxxxxxxx
1
2
<html>
3
<body>
4
<img height="16" width="16" src='https://icons.duckduckgo.com/ip3/www.youtube.com.ico' />
5
</body>
6
</html>
0 commentsShow commentsAdd comment