Firefox无法登录Google Drive Picker API,授权后关闭且Chrome现也报错
Google Drive Picker API 登录异常问题
我目前遇到了一个跨浏览器的问题:在Firefox中无法登录Google Drive Picker API,但在Chrome里可以正常使用。
Firefox 中的具体问题
- 打开控制台会看到这个CSP相关错误:
Content Security Policy: Ignoring 'unsafe-inline' within script-src: 'strict-dynamic' specified - 为了排查,我尝试设置了一个允许所有内容的CSP元标签,但在OSX的Firefox 60版本里还是无法加载Drive Picker:
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'; img-src * data: 'unsafe-inline'; connect-src * 'unsafe-inline'; frame-src *;"> - 我已经把应用的域名添加到了Google的批准列表里,但因为认证流程是由Google接管的,我不知道该怎么进一步调试。控制台显示加载到这个地址后就停止了:
https://ssl.gstatic.com/accounts/o/3723580519-idpiframe.js - 我感觉这个问题和Google Drive认证后自动关闭的情况类似,而且我使用的是Google提供的默认示例代码。
Chrome 中出现的新错误
原本Chrome是正常的,但现在访问同一个https://ssl.gstatic.com/accounts/o/3723580519-idpiframe.js地址时,控制台抛出了这个错误:
Uncaught TypeError: (b || "").split is not a function
这个问题看起来和google-api-javascript-client项目里一个未更新的issue有关联。
内容的提问来源于stack exchange,提问作者Brian Barthold
相关产品推荐
相关产品推荐

