electron 跨域问题 六

webSecurity是什么意思呢?顾名思义,他是设置web安全性,若是参数设置为 false,它将禁用相同地方的规则 (一般测试服), 而且若是有2个非用户设置的参数,就设置 allowDisplayingInsecureContent 和 allowRunningInsecureContent的值为true。 (webSecurity的默认值为truejavascript

allowDisplayingInsecureContent表示是否容许一个使用 https的界面来展现由 http URLs 传过来的资源。默认false
allowRunningInsecureContent表示是否容许一个使用 https的界面来渲染由 http URLs 提交的html,css,javascript。默认为 falsecss

 

mainWindow = new BrowserWindow({
    webPreferences: {webSecurity: false},
  })
相关文章
相关标签/搜索
本站公众号
   欢迎关注本站公众号,获取更多信息