Javascript Firebase auth未在chrome上运行
我不知道这是什么时候发生的,因为在开发过程中,我在浏览器中启动了一个会话,所以我不必再次通过谷歌或Facebook等提供商登录。当一个新用户尝试登录我的web应用程序时,她告诉我有一个错误。因此,我清理了我的浏览器数据,并开始显示消息Javascript Firebase auth未在chrome上运行,javascript,authentication,firebase,Javascript,Authentication,Firebase,我不知道这是什么时候发生的,因为在开发过程中,我在浏览器中启动了一个会话,所以我不必再次通过谷歌或Facebook等提供商登录。当一个新用户尝试登录我的web应用程序时,她告诉我有一个错误。因此,我清理了我的浏览器数据,并开始显示消息出现网络错误(例如超时、连接中断或无法访问主机)。当浏览器尝试打开Google或Facebook登录的弹出窗口时。它不会发生在Safari或我的Android Chrome中 这里有一段代码片段作为参考 <!-- @license Copyright (c)
出现网络错误(例如超时、连接中断或无法访问主机)。
当浏览器尝试打开Google或Facebook登录的弹出窗口时。它不会发生在Safari或我的Android Chrome中
这里有一段代码片段作为参考
<!--
@license
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/paper-button/paper-button.html">
<link rel="import" href="../bower_components/polymerfire/polymerfire.html">
<link rel="import" href="shared-styles.html">
<dom-module id="my-view1">
<template>
<style include="shared-styles">
:host {
display: block;
padding: 10px;
}
</style>
<div class="card">
<div class="circle">1</div>
<paper-button on-tap="login">Login</paper-button >
<h1>View One</h1>
<p>Ut labores minimum atomorum pro. Laudem tibique ut has.</p>
<p>Lorem ipsum dolor sit amet, per in nusquam nominavi periculis, sit elit oportere ea.Lorem ipsum dolor sit amet, per in n#
</div>
</template>
<script>
Polymer({
is: 'my-view1',
login: function(){//{{{
firebase.initializeApp({
apiKey: apiKey,
authDomain: authDomain,
databaseURL: databaseURL
});
var provider = new firebase.auth.FacebookAuthProvider();
firebase.auth().signInWithPopup(provider).then(function(result){
console.log(result);
}).catch(function(error){
console.error( error);
});
},//}}}
});
</script>
</dom-module>
:主持人{
显示:块;
填充:10px;
}
1.
登录
视图一
Ut致力于最低限度的atomorum pro。劳登·提比克·尤特
同侧盲蝽(Lorem ipsum dolor sit amet),每只幼鸟(nusquam nominavi periculis),每只幼鸟(elit oporte ea)一只。同侧盲蝽(Lorem ipsum dolor sit amet),每只幼鸟一只,每只幼鸟一只#
聚合物({
是:‘我的视图1’,
登录:函数(){//{{{
firebase.initializeApp({
阿皮基:阿皮基,
authDomain:authDomain,
databaseURL:databaseURL
});
var provider=new firebase.auth.FacebookAuthProvider();
firebase.auth().signInWithPopup(提供程序)。然后(函数(结果){
控制台日志(结果);
}).catch(函数(错误){
控制台错误(error);
});
},//}}}
});
我认为你应该在有人点击登录之前初始化应用程序
firebase.initializeApp({
apiKey: apiKey,
authDomain: authDomain,
databaseURL: databaseURL
});
无论何时有人登陆页面,这可能是最好的选择。我认为你应该在有人点击登录之前初始化应用程序
firebase.initializeApp({
apiKey: apiKey,
authDomain: authDomain,
databaseURL: databaseURL
});
每当有人登陆页面时,可能是执行此操作的最佳位置。我转到并单击删除所有内容。这为我解决了问题。我转到并单击了删除所有内容。这为我解决了问题。不。。不是吗。我已经测试过了,不。。不是吗。我已经测试过了。