Chrome 45 CSP child-src for blob

Chrome 45 CSP child-src for blob

本文关键字:for blob child-src CSP Chrome      更新时间:2023-09-26

我更新到Chrome 45.0.2454.85(64位)和我的blobs的child-src策略不再工作。

错误:

Refused to create a child context containing 'blob:http%3A//localhost%3A3000/80ec57ff-e6ae-4591-8526-6c9f0c412b51' because it violates the following Content Security Policy directive: "child-src 'self' http://localhost:3000 blob:http://localhost:3000 blob:http://localhost 'blob://localhost:3000'".

正如你所看到的,我已经尝试了几种不同的策略。

  • http://localhost: 3000
  • blob: http://localhost: 3000
  • blob: http://localhost
  • "blob://localhost: 3000"

我需要添加什么child-src策略,以便我可以在localhost:3000上运行javascript blobs ?

添加blob:到child-src

更多信息:https://developer.mozilla.org/en-US/docs/Web/Security/CSP/CSP_policy_directives#endnote_2