Hey Takuji,
We've made some progress and you can now have Firebase working in Chrome Extensions.
While we do not support signInWithPopup/Redirect in Chrome extensions/apps yet, you can work around it by using the chrome.identity API. You need to do the following:
- Use the OAuth token to authorize Firebase using Auth.signInWithCredential. Basically the core of the auth code should look like: chrome.identity.getAuthToken({}, function(token) {
var credential = firebase.auth.GoogleAuthProvider.credential(null, token);
firebase.auth().signInWithCredential(credential);
});
- You can remove the `authDomain` attribute of the `config` Object in the Firebase SDK initialization code to avoid loading the auth iFrame (which would improve performance a bit and is only needed for signInWithPopup/Redirect).
While this is a bit more work and set up than using signInWithPopup this offers a nice 'native'-like experience as the chrome.identity API uses the account the chrome browser is signed-in with.
I'm working on a sample that I'll publish hopefully tomorrow.
Let me know if you have any questions.
Cheers!