Cloud Firestore not returning data when used inside chrome extension

I’m trying to use firestore inside a chrome extension and I set everything up following some docs I found through google.

In my manifest.json file I added this:

"content_security_policy": "script-src 'self' https://www.gstatic.com https://*.firebaseio.com; object-src 'self'"

And inside a html file where I want to use firestore, I’m including these:




In that same html file, I’m including another js file which has the following code:

var config = {
    apiKey: "xxx",
    authDomain: "xxx",
    databaseURL: "xxx",
    projectId: "xxx",
    storageBucket: "xxx",
    messagingSenderId: "xxx"
  };

firebase.initializeApp(config);

firebase.firestore().collection('users').onSnapshot(function(snapshot) {
    console.log(snapshot.docs);
});

The problem is that snapshot.docs is always an empty array despite some data actually existing. There are no errors or warnings. It just returns an empty array.