带有 Firefox Web 扩展插件的 Firebase 身份验证

Abh*_*tra 4 firefox-addon firebase firebase-authentication firefox-addon-webextensions

我正在为 chrome 和 firefox 创建一个网络扩展。我已经集成了 firebase UI 和 firebase auth。Google 身份验证在 chrome 扩展上运行良好。但是在 Firefox 扩展/附加组件上,它给了我以下错误。

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.

我尝试了几件事,但没有奏效。

  1. 尝试moz-extension://dhhjsbhjbajnsabjajbasjbhjasjh 在 Firebase 身份验证控制台中添加授权域。验证错误。
  2. 都尝试pop upredirect登录方法。

其他开发人员在为cordova 或ionic 进行开发时也面临类似的问题

boj*_*eil 6

Firebase 身份验证不支持 Firefox 扩展。您可以为此提交功能请求

同时,您可以通过从扩展程序打开的弹出窗口登录用户,然后 CORS 将结果发送给扩展程序,确保在执行此操作之前检查扩展程序的来源。例如,假设您使用 OAuth 提供商登录,打开您拥有的弹出窗口,使用 Firebase 登录,然后将 OAuth 访问令牌传递给扩展程序,然后signInWithCredential从那里传递。