【发布时间】:2017-06-21 16:16:09
【问题描述】:
未捕获的异常:错误:此操作在 此应用程序运行的环境。 “location.protocol”必须 必须是 http、https 或 chrome 扩展,并且必须启用网络存储。
var config = {
apiKey: "*****",
authDomain: "******",
};
firebase.initializeApp(config);
var provider = new firebase.auth.GoogleAuthProvider();
provider.addScope('profile');
provider.addScope('https://www.googleapis.com/auth/drive');
firebase.auth().signInWithRedirect(provider);
alert(1);
}
【问题讨论】:
-
看起来像 http 的问题,驱动 sdk 要求您的 authdomain 为 https://
-
您的实际问题是什么?
-
该代码仅在本地主机上运行。是否可以在没有任何网络浏览器的情况下运行该代码
-
其他文档建议运行
firebase serve-- 但我不确定默认端口是什么。
标签: javascript firebase google-drive-api firebase-authentication adobe-indesign