WordPress + Disqus +拒绝执行内联脚本

ele*_*nor 10 xss wordpress disqus content-security-policy

我在我的Wordpress网站上加载了Disquss,该网站运行在HTTPS上.问题是,虽然评论显示在网页的底部,但它们是白色的(并且由于页面的背景也是白色的,因此它们不可见).

如果我在Chrome中打开Inspector,则会在控制台选项卡上打印以下错误.

    Refused to execute inline script because it violates the following
 Content Security Policy directive: "script-src https://*.twitter.com:* 
https://api.adsnative.com/v1/ad.json *.adsafeprotected.com *.google-analytics.com https://glitter-services.disqus.com 
https://*.services.disqus.com:* disqus.com http://*.twitter.com:* 
a.disquscdn.com api.taboola.com referrer.disqus.com *.scorecardresearch.com 
*.moatads.com https://admin.appnext.com/offerWallApi.aspx 'unsafe-eval' 
https://mobile.adnxs.com/mob *.services.disqus.com:*". Either the 'unsafe-
inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required
 to enable inline execution.
Run Code Online (Sandbox Code Playgroud)

这是因为Chrome中的弹出窗口拦截器扩展,但我想通过内容安全策略启用它:http://www.html5rocks.com/en/tutorials/security/content-security-policy/.基本上,错误发生在chrome-extension://*方案中,因此我需要在Content-Security-Policy中添加适当的条目以允许chrome扩展.

我应该如何禁用Chrome扩展程序的安全策略?

小智 0

我应该如何禁用 Chrome 扩展的安全策略?

不是。另外你不能

我需要向 Content-Security-Policy 添加适当的条目以允许 chrome 扩展。

扩展的 CSP 是(本地)扩展的一部分。

虽然评论显示在网页底部,但它们是白色的,对我来说听起来像是 CSS 的问题……那么color: black;您的文本呢?

简而言之:网站无法干扰扩展。这很好 - 我不希望 facebook 禁用我的 CSP 并将我的个人色情偏好(来自 PornLiner 插件)发送到我的个人资料。