TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Favicons Next To External Links

97 点作者 nantes将近 13 年前

6 条评论

toni将近 13 年前
There is another - and more simplified - version of Google favicons service:<p><a href="http://s2.googleusercontent.com/s2/favicons?domain_url=" rel="nofollow">http://s2.googleusercontent.com/s2/favicons?domain_url=</a><p>You can also pass a full URL to domain_url parameter, e.g.:<p><a href="http://s2.googleusercontent.com/s2/favicons?domain_url=http%3A%2F%2Fnews.ycombinator.com%2Fitem%3Fid%3D4028603" rel="nofollow">http://s2.googleusercontent.com/s2/favicons?domain_url=http%...</a><p>So no need to find the host name, just be sure to encode the URL<p>It also works with HTTPS connection.
mrspandex将近 13 年前
This seems like it would make malicious links easier to seem legitimate. If I see the Google favicon, I might assume it was Google without even checking the URL.
评论 #4029567 未加载
评论 #4028910 未加载
Steuard将近 13 年前
I don't know how much of an issue this is in practice, but if the Google favicon service only requires the hostname then it will sometimes get the icon wrong. Any individual page can specify its own icon via a link element in the page header. (This is essential when multiple sites share the same host.) Is there any reasonable way to deal with that?
rgrieselhuber将近 13 年前
Wouldn't work in an HTTPS site I assume (due to browser warnings over insecure resources...)?
评论 #4029369 未加载
评论 #4029096 未加载
dreur将近 13 年前
Or a simple JQuery Plugin I developed: <a href="https://github.com/dreur/JQuery-Showfavicons-Plugin" rel="nofollow">https://github.com/dreur/JQuery-Showfavicons-Plugin</a><p>It adds the possibility to say which hostnames are internal and external.
nowarninglabel将近 13 年前
I really like the message next to the comment box on this site, makes you think twice about what you are going to say.