4 ms·
N.B. this is going to send a request to duck duck go for every link which (a) some people aren't going to like, and (b) DDG might not like (I couldn't find any
by andreareina 5y ago
N.B. this is going to send a request to duck duck go for every link which (a) some people aren't going to like, and (b) DDG might not like (I couldn't find any explicit policy for using their favicon service).
- anais9 5y agoThis - an alternative approach could be to create the images with a URL of '{domain}/favicon.ico' and then add an onError event to switch the URL to the DDG URL only for instances where the site's favicon isn't in the default location.
- Beltalowda 5y agoMany sites have png favicons that may be stored anywhere. You kind of need to parse the HTML to be sure, and I guess that's what the DDG service does.
- anais9 5y agoFor sure, but even a lot of those sites maintain a favicon.ico to support legacy crawlers/systems - then for those that don't (i.e. trigger onError), falling back to DDG's icon is an easy way to skip all that parsing.
- memorable 5y agoI actually have this exact thought (just without the fallback) a few minutes ago.
- frabert 5y agoThat's true, and if people don't like the idea of sending requests to DDG I completely understand. However regarding the increase in traffic: doing any kind of search on DDG sends a request for each link just like this script does, and I don't think the amount of users that are going to use this script is going to cause major issues. Still, it's a grey area and its use is not endorsed by DDG in any way.
- Jaruzel 5y agoGoogle have the same service[1] if that's your thing. I've been using it on a links heavy dashboard page for a couple of years now, and it always worked. I'll probably switch to DDG now tho. --- [1] https://www.google.com/s2/favicons?domain=example.com https://www.google.com/s2/favicons?domain=example.com