Firebase Auth with Firefox Web Extension Add On

和自甴很熟 提交于 2019-12-22 17:16:10

问题


I am creating a web extension both for chrome and firefox. I have integrated firebase UI and firebase auth. Google authentication works well on chrome extension. But on firefox extension/add-on it gives me the following error.

This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.

I tried couple of things, but none worked.

  1. Tried adding moz-extension://dhhjsbhjbajnsabjajbasjbhjasjh in authoirsed domain in firebase auth console. Validation error.
  2. Tried both pop up and redirect sign in methods.

Similar issue is faced by other developers while developing for cordova or ionic


回答1:


Firefox extensions are not supported by Firebase Auth. You can file a feature request for this.

In the meantime, you can sign in the user via a popup opened from the extension and then CORS postMessage the result to the extension, making sure you check the origin of the extension before you do so. For example, assuming you are signing in with an OAuth provider, open a popup you own, sign in with Firebase, then pass the OAuth access token to the extension and then signInWithCredential from there.



来源:https://stackoverflow.com/questions/48518887/firebase-auth-with-firefox-web-extension-add-on

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!