If I try to use Firebase simple login from a popup window in Firefox, the popup window closes itself and I never get logged in. Everything works fine if the new window is not a popup (i.e. if it's just another tab). Everything works fine in Chrome regardless of whether the new window is a popup or not.
Here is my first html file:
<script>
function chromeless() {
var s = "width=" + 1200 + ",height=" + 200
var win = window.open('http://localhost:5000/tests/login.html',null,s,true)
return win
}
</script>
<a href="#" onclick="chromeless()">Launch app</a>
Here is login.html:
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js'>
</script>
<script src='https://cdn.firebase.com/v0/firebase.js'></script>
<script src="https://cdn.firebase.com/js/simple-login/1.6.1/firebase-simple-login.js"></script>
<button id="login-github" style="display: none">Log in with GitHub</button>
<script>
var ref = new Firebase('https://taskranger.firebaseio.com/')
var auth = new FirebaseSimpleLogin(ref, function(err, user) {
if(err)
alert(err)
else if(user)
console.log('logged in:', user)
else
$('#login-github').show()
})
$('#login-github').click(function() { auth.login('github', { rememberMe: true }) })
</script>
You can resolve this by naming your popup window in your index.html:
<script>
function chromeless() {
var s = "width=" + 1200 + ",height=" + 200
var win = window.open('./login.html',"any_valid_window_name",s,true)
return win
}
</script>
<a href="#" onclick="chromeless()">Launch app</a>
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments