And*_*unt 2 javascript adblock addthis mathjax
启用 AdBlock 后,出现以下错误:
添加这个: Uncaught Error: Must pass a string which will eval to a
globally accessible object where callbacks will be stored
MathJax: Uncaught EvalError: Refused to evaluate a string as
JavaScript because 'unsafe-eval' is not an allowed source of script
in the following Content Security Policy directive: "script-src
'self' * 'unsafe-inline'".
当 AdBlock 被禁用时,一切正常。
问题出现在几周前。
即使启用了 AdBlock,在使用 MathJax 的网站上一切正常:https ://www.mathjax.org和https://math.stackexchange.com/
可能有些事情发生了变化,我需要正确更改代码。如何?
提前致谢。
这两个错误都涉及相同的内容安全策略 (CSP) 问题,即eval()不允许不安全的调用。AdBlock 和 Adblock Plus 等广告拦截器最近开始在传统技术不足的情况下使用 CSP(请参阅Adblock Plus 过滤器选项)。
我只能在 emathhelp.net 上重现它。在那里,我找到了||emathhelp.net^$csp=script-src 'self' * 'unsafe-inline'对此负责的过滤器,该过滤器已于 5 月 15 日添加到 EasyList 广告阻止列表中。在 Adblock Plus 中,您可以按照以下步骤找到此类过滤器:
您可以联系 EasyList(GitHub、论坛、网站)以了解他们添加特定过滤器的原因。他们还应该能够帮助您恢复损坏的任何功能。