Skip to content

Messaging in Firefox private mode (IndexedDb) #5868

@vandres

Description

@vandres

[REQUIRED] Describe your environment

  • Operating System version: MacOS Monterey
  • Browser version: Firefox 95.0.2 (and Tor)
  • Firebase SDK version: 9.1.6 (modular)
  • Firebase Product: messaging

[REQUIRED] Describe the problem

We recently upgraded our Angular app to Firebase v9 Modular. After some DNS changes we tested our app with Tor and were presented with a white page. We then reproduced the issue with Firefox private mode. Normal Firefox sessions work. When allowing browser history in Firefox private mode, it also works.

When using the private mode, we see the following error: Unhandled Promise rejection: A mutation operation was attempted on a database that did not allow mutations. ; Zone: <root> ; Task: Promise.then ; Value: A mutation operation was attempted on a database that did not allow mutations.

I tried disabling IndexedDb then for the whole app, but the problem lies within in the initialization of the messaging module.

async function isWindowSupported() {
    // firebase-js-sdk/issues/2393 reveals that idb#open in Safari iframe and Firefox private browsing
    // might be prohibited to run. In these contexts, an error would be thrown during the messaging
    // instantiating phase, informing the developers to import/call isSupported for special handling.
    return (typeof window !== 'undefined' &&
        isIndexedDBAvailable() &&
        (await validateIndexedDBOpenable()) &&
        areCookiesEnabled() &&
        'serviceWorker' in navigator &&
        'PushManager' in window &&
        'Notification' in window &&
        'fetch' in window &&
        ServiceWorkerRegistration.prototype.hasOwnProperty('showNotification') &&
        PushSubscription.prototype.hasOwnProperty('getKey'));
}

Steps to reproduce:

Any app using AngularFire with the messaging module should be affected: https://github.com/angular/angularfire

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions