I\'m working on a chrome extension and trying to implement an authentication method (firebase). I\'m confused by what has to go where, since the popup.html doesn\'t allow in
You could try to have the login/password input boxes in the popup but run the actual login code in the background page. You can do that sending a message from the popup to the background page or directly from the popup using something like:
popup.html:
<input type="text" id="email">
<input type="password" id="password">
popup.js:
var email = document.getElementById("email").value;
var password = document.getElementById("password").value;
chrome.runtime.getBackgroundPage(function(bgPage){
bgPage.performFirebaseLoginWithEmailAndPassword(email,password);
});
Since the background page is always on, the login state should be preserved when the popup is closed.