Does Topic messaging work with chrome extensions?

I am trying to implement Chrome Extension that receives push messages from Firebase.I have tried referring firebase docs but I cannot find any info regarding this.Is it possible to implement the same? Any reference document link is appreciated.

google chrome extension- push notification

I am working on chrome extension for push notifications.As of now I have an instance which is subscribed to a topic and when I broadcast a messsage on that topic using firebase ,a push notification is received .But I want to retrieve the data from the push event and display using chrome notification create method.Is it possible?I need some reference documents on this.

firebase.auth().signInWithPopup() not works with Chrome extension on Linux/Mac

I am developing a chrome extension.I have used firebase google sign for authentication using firebase.auth().signInWithPopup() method.

It works well with Windows.But it do not works with Linux/Mac OS. A popup window appears for a while then it disappears.
Please suggest Solution.

Firebase Phone Number authentication in Chrome Extension

Is it possible?
I read a bit on https://firebase.google.com/docs/auth/web/phone-auth but it mentions OAuth redirect domains all the time, not sure if chrome extension domains are valid for this?

Chrome – Still getting “refused to load script due to CSP” even after using “unsafe-inline”

This is for a class project that is due very soon, so I am OK with the unsafe-inline (since people won’t actually be using our app).

I keep getting these errors
and have tried to find solutions here and elsewhere.

This is in my manifest.json file

{
 "name": "Getting Started Example",
 "version": "1.0",
 "description": "Build an Extension",
 "permissions": ["activeTab", "declarativeContent", "storage"],
 "content_security_policy": "script-src 'unsafe-inline' http://* 
  https://ajax.googleapis.com; object-src 'unsafe-inline' http://*"}
 "background": {
 "scripts": ["background.js"],
 "persistent": false
},

I initialize Firebase using the code from the Firebase site in my options.html



I have also tried putting this in my options.js file without the script tags, but then I get “firebase is not defined”

How can I stop getting this error? I thought I was giving it all the permissions, but I still keep getting the same error.

The lines that the error points to, in my options.html, are:

LINE 1


LINE 13 is just < script > on a single line…

How do I listen for Firebase Cloud Messaging messages in the background in a Google Chrome Extension?

I have a Google Chrome Extension that listens for GCM messages in a background script via chrome.gcm.onMessage.addListener. Our provider is planning to upgrade their infrastructure to use the latest Firebase Cloud Messaging which is no longer compatible with GCM. We’ve confirmed the gcm addListener API no longer receives messages after upgrading to FCM in the dev environment.

I’ve found migration guides for Android, iOS, and progressive web apps but none specifically for background scripts in Chrome extensions.

Some resources I’ve found:

How to fix UTF-8 Firebase Error for Content Script w/ Chrome Extension Manifest.json?

I made a Chrome Extension and am using Firebase to authenticate users. I downloaded the Firebase.js from https://www.gstatic.com/firebasejs/4.11.0/firebase.js, hoping to add the firebase code to my chrome extension manifest. The Firebase auth is happening in a content script, so it needs to be included in the “js” under “content_scripts”.

Manifest.json Content Script Example

Instead, I’m getting a UTF-8 error when putting firebase.js.

Error:
Could not load file ‘js/lib/firebase.js’ for content script. It isn’t UTF-8 encoded.
Could not load manifest.

I tried using TextEdit on Mac to save the file as UTF-8 – still not luck.

What am I doing wrong?

Adding the firestore library to the manifest.json

So i’ve been working on a google chrome extension which alters HTML in a list of specific pages. What this means is that I don’t have an HTML file to insert the firebase and firestore library urls into, which should then go into the manifest.json file.

After having downloaded the actual library files and added them to the content_scripts the firestore library seems to be throwing a error which tells me the firestore library file is not UTF-8 encoded. The firebase library itself works perfectly fine but the firestore file won’t.

I’ve tried working around this issue by loading the libraries inside of my background.html and somehow parsing the data I get there to my actual app but this seemed very unpractical. There is also not a lot to be found when specifically looking for a combination between firestore and google chrome extentions.

UTF-8 Encoding the firestore file with the standard mac-os tools didn’t do much for me either, as is suggested by one other issue I found on this matter.

So my question pretty much sums up to: “How do you include the firestore library into a google chrome extension through the manifest.json?”.

Thanks for reading, help would be very much appreciated!

Firebase re-authenitcate user. How to get correct token?

I’m working on chrome extension (provides main functionality) and the complementary website (mostly profile and billing related functionality) both backed with firebase backend.

I’m wondering if it’s possible to implement the below scenario:

  • user logs in with the extension using firebase authentication (with firebaseUI lib)
  • I store a token that I can use to reauthenticate that user (is there such a token?)
  • when user opens the website, I login that user automatically with the token.

While both the extension and the website has their login/signup forms I’m wondering if it’s possible to login user in the extension and to somehow automatically login that same user on the website so they don’t have to enter their credentials twice?

So far I was hoping that I could use something like below:

firebase.auth().currentUser.getIdToken(true).then(function(idToken) {
            console.log("idToken = ", idToken)
})

And then to use that idToken like this, since if I understand correctly, it’s an AWT:

firebase.auth().signInWithCustomToken(idToken).catch(function(error) {
    // Handle Errors here.
     var errorCode = error.code;
     var errorMessage = error.message;
     console.log("signInWithCustomToken: error = ", error)
 })

But it gives the following error:

code: "auth/invalid-custom-token"
message: "The custom token format is incorrect. Please check the documentation."

I can parse the token on https://jwt.io/ which shows all the user information but in the end it says “invalid signature”

So I guess this token can be only used to check authentication (like admin.auth().verifyIdToken(idToken)) but not to login user. Am I right?

I know I can create a custom token, but is there any straightforward way to workaround that and to login user from one place only using firebase funstionality? (of course without storing username/password)

Unrecognized manifest key ‘gcm_sender_id’ ,Chrome extension linked to fcm

am trying to link a chrome extension to firebase cloud messaging, but am getting
Unrecognized manifest key ‘gcm_sender_id’ error when i load the extension
image of the error,
here is my manifest file:

   {

  "manifest_version": 2,
  "name": "iQU",
  "description": "iQU",
  "version": "1.0",
  "browser_action": {
    "default_icon": "icon.png",
    "default_popup": "index.html"
  },
  "permissions": [],
  "content_security_policy": "script-src 'self' 'unsafe-eval' https://cdn.firebase.com https://*.firebaseio.com https://*.firebaseio.com; object-src 'self'; ",
  "web_accessible_resources": [
    "assets/css/*",
    "assets/js/*",
    "assets/fonts/*"
  ],
  "gcm_sender_id": "103953800507"
}

any help please?