node.js - Electron 快速入门拒绝连接到 'https://oauth2.googleapis.com/token'

标签 node.js electron

我正在尝试在 Electron 内部使用Google Drive API快速入门项目。这是我的示例项目:
electron quickstart with google api

how it should works:
when click authorize button, it'll redirected to authUrl then we can copy the authorization key, insert the authorization key page to input with id 'key'


当我用 Electron 运行时,它返回以下错误:
D:\koding\electron-example\gdrive\node_modules\gaxios\build\src\gaxios.js:68 Refused to connect to 'https://oauth2.googleapis.com/token' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback.
该如何解决呢?

最佳答案

从这个帖子回答refused-to-load-the-script-because-it-violates-the-following-content-security
我们需要指定内容安全性允许的地址类型

关于node.js - Electron 快速入门拒绝连接到 'https://oauth2.googleapis.com/token',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64382740/

相关文章:

node.js - NodeJS : Keeping library files DRY

node.js - SFTP 至 HP-不间断

javascript - html 没有呈现我的图像并且源是正确的

node.js - express-openapi-validator:错误:TypeError:无法读取未定义的属性 'schema'

angular - Karma 单元测试错误 : Unexpected value imported by the module. 请添加@NgModule 注释

webpack - 来自UglifyJs的renderer.js中的错误意外的标记点«(»

javascript - Electron:Dragula 不工作?

electron - codemirror - 行号与代码重叠

node.js - 如何将 app.js 中的变量传递到路由文件?

vue.js - Vue 2.0.1和Electron-可视Flash