Strange CSP error in Firefox

这一生的挚爱 提交于 2019-12-24 00:58:15

问题


I recently added the following CSP policies for https://stefan.sofa-rockers.org/

default-src 'self'; style-src 'self' https://brick.a.ssl.fastly.net; font-src 'self' https://brick.a.ssl.fastly.net

It seems to work well on all browser, but Firefox is showing me this strange, truncated error message:

Content Security Policy: The page’s settings blocked the loading of a resource at self (“default-src https://stefan.sofa-rockers.org”). Source: (function (ERROR) {

    const V8_STACK_.... stefan.sofa-rockers.org:1

Do I have an error in my CSP (all resources are getting loaded, so I don't think this is the case) or might this be a bug in Firefox itself?


回答1:


It looks like you may be hitting a known Firefox bug that’s been partially fixed in Firefox 58. See the Improved Content Security Policy (CSP) Handling section of the following blog post:

https://blog.mozilla.org/addons/2017/11/20/extensions-in-firefox-58/

The relevant existing Firefox bugs are these:

  • https://bugzilla.mozilla.org/show_bug.cgi?id=1406278
  • https://bugzilla.mozilla.org/show_bug.cgi?id=1267027

And specifically, as noted in the comments here, if you have the Privacy Badger add-on installed, you might need to consider disabling it.

See also the following related Stack Overflow answers:

  • Firefox content script not loading in some pages
  • Content Security Policy failing on line 1 (Firefox 57.0)


来源:https://stackoverflow.com/questions/47720227/strange-csp-error-in-firefox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!