【发布时间】:2021-05-12 08:02:42
【问题描述】:
好吧,我只是迷路了。我打开了一个电子启动应用程序并添加了一个简单的代码,以控制台登录按钮按下。该函数位于文件 renderer.js 中,并在我的 index.html 中被调用。为什么当我按下按钮 我收到这条消息....
Refused to execute inline event handler because it violates the following Content
Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a
hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.
为什么不允许我内联执行某些内容?外部来源似乎更容易受到攻击。谁能帮我解决这个问题?
【问题讨论】:
-
没有你的代码,没有人能理解为什么会出现这个错误。
标签: javascript security electron