如何阻止Adsense在https网站上加载混合内容?

时间:2017-02-09 13:37:14

标签: https adsense

我的https网站上出现间歇性混合内容错误。网站链接为stakeholdermap.com

我已查看Chrome开发工具>网络标签,我看到下面的不安全网址示例:

Mixed Content: The page at 'https://www.stakeholdermap.com/stakeholder-analysis.html' was loaded over HTTPS, but requested an insecure plugin data 'http://static.vertamedia.com/static/vpaid-ssp-vast.swf?aid=41476&sid=0&cb=146233.42079096.743365'. This content should also be served over HTTPS. ads?client=ca-pub-3370240294319443&format=300x250&output=html&h=250&slotname=8722343817&adk=5159607…

Mixed Content: The page at 'https://www.stakeholdermap.com/stakeholder-analysis.html' was loaded over HTTPS, but requested an insecure plugin data 'http://ads2.vertamedia.com/vast/vpaid-config/?width=300&height=250&aid=4147…takeholdermap.com&v=2.2.90&t=flash&video_duration=&cb=73026784276589750000'. This content should also be served over HTTPS.

但广告位正在使用最新代码(//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js)

我很确定这些是由Adsense加载的。我的问题是如何阻止它或强制它使用https?

1 个答案:

答案 0 :(得分:2)

如果可能,请用户浏览器获取安全内容: <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" /> 如果广告可通过https获取,则会获取该版本,否则,内容将被屏蔽,而其他内容将显示在其位置。将元数据放在网页的<head>部分,其中包含所有其他元标记。

您可以在此处找到更多信息:https://developers.google.com/web/fundamentals/security/prevent-mixed-content/fixing-mixed-content