【发布时间】:2019-07-20 20:31:23
【问题描述】:
我正在使用 Chrome 开发工具来审核我网站的主页。它为我主页中的 facebook、twitter 和 linkedin 共享按钮提供了“预连接到所需来源”的机会之一。
我在https://developers.google.com/web/fundamentals/performance/resource-prioritization阅读了关于preconnect和dns-prefetch的google文章,但发现语法仅适用于链接标签,如下:
但在我的主页中,连接到社交网站的分享按钮是这样的:
<div class="fb-like" data-href="https://www.facebook.com/xxxx" data-
send="false" data-layout="button_count" data-width="90" data-show-
faces="true"></div>
或者这个:
<a href="https://twitter.com/share" class="twitter-share-button" data-
count="none">Tweet</a>
或者这个:
<script src="https://platform.linkedin.com/in.js" type="text/javascript">
</script>
<script type="IN/Share"></script>
在这种情况下,如何在 html 代码中添加 preconnect 或 dns-prefetch 提示?好像这些提示只对link标签有效?
谢谢
【问题讨论】:
标签: html google-chrome-devtools hint