webSecurity
是什么意思呢?顾名思义,他是设置web安全性,若是参数设置为 false
,它将禁用相同地方的规则 (一般测试服), 而且若是有2个非用户设置的参数,就设置 allowDisplayingInsecureContent
和 allowRunningInsecureContent
的值为true
。 (webSecurity
的默认值为true
)javascript
allowDisplayingInsecureContent
表示是否容许一个使用 https的界面来展现由 http URLs 传过来的资源。默认false
。
allowRunningInsecureContent
表示是否容许一个使用 https的界面来渲染由 http URLs 提交的html,css,javascript。默认为 false
。css
mainWindow = new BrowserWindow({ webPreferences: {webSecurity: false}, })