内容安全策略:页面的设置阻止了 blob 资源的加载

Content Security Policy: The page’s settings blocked the loading of a resource at blob

由于 Waterfox 56 中的内容安全策略,Blob 图像未通过 JavaScript 显示:

Content Security Policy: The page’s settings blocked the loading of a resource at blob:http://localhost/1e511fde-fb52-41fc-b7db-6b8b6cf64171 (“img-src http://localhost data:”).

我的图像 CSP:

img-src \'self\' data:;

自我回答,见下文。

添加 blob: 解决了问题,仅使用 space 作为数组分隔符(以及 key/value 对分隔符的分号):

之前:

img-src \'self\' data:;

之后:

img-src \'self\' blob: data:;