Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Electron 如何在电子应用程序中包含模板组件的分发_Electron_Content Security Policy_Stenciljs - Fatal编程技术网

Electron 如何在电子应用程序中包含模板组件的分发

Electron 如何在电子应用程序中包含模板组件的分发,electron,content-security-policy,stenciljs,Electron,Content Security Policy,Stenciljs,我真的无法在项目中包含模具分布。由于electron是无头铬合金,难道不可能将其作为脚本包含吗 关于安全策略,我似乎有一个错误 模具版本: 1.12.2 它们在独立的html中工作得很好 index-64aa1cf6.js:2443 Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'self'". Either the '

我真的无法在项目中包含模具分布。由于electron是无头铬合金,难道不可能将其作为脚本包含吗

关于安全策略,我似乎有一个错误

模具版本: 1.12.2

它们在独立的html中工作得很好

index-64aa1cf6.js:2443 Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-imoMl/F66ZbGZfn+J0jtlxdZvr/1ZBs+8ReasI4LBKQ='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.

bootstrapLazy @ index-64aa1cf6.js:2443
index-64aa1cf6.js:2888 Refused to load the script 'blob:file:///f7aff0d4-a09c-464c-8344-451ac3a43fba' because it violates the following Content Security Policy directive: "script-src 'self'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

电子不是无头铬,它是基于铬的

错误消息告诉您已启用CSP(内容安全策略),因此已阻止加载脚本和内联样式

您可以更改CSP规则以允许加载该脚本,也可以禁用CSP(不太安全)

链接:

问题还可能是您试图使用
blob:file://
协议包含脚本


对于阻塞内联样式,您可以向指令中添加nonce或散列源(更安全),或者使用
“unsafe-inline”

谢谢,我会看看我能做些什么。我认为部分原因可能是,模具包使用多个JS文件。