Firebase-js-sdk: FR: Firebase Messaging: SDK installation crashes in Edge InPrivate

Created on 20 Dec 2019  路  5Comments  路  Source: firebase/firebase-js-sdk

Describe your environment

  • Operating System version: Windows 10 Enterprise Evaluation (version 1809, build 17763.379)
  • Browser version: Microsoft Edge 44.17763.1.0 (Microsoft EdgeHTML 18.17763)
  • Firebase SDK version: 7.6.1
  • Firebase Product: messaging

Describe the problem

Messaging product of firebase SDK has idb dependency, which throws uncatched errors.
This causes crashes on Microsoft Edge in InPrivate mode. Also in Firefox in private mode throws uncatchable error.

Steps to reproduce:

  1. Install Firebase SDK to web page
  2. Initiate the firebase app with messaging product
  3. Open the web page with Microsoft Edge in InPrivate browsing
  4. SDK Initialization will crash because IndexedDB's apis are undefined in Edge's InPrivate mode

Relevant Code:

https://stackblitz.com/fork/firebase-issue-sandbox

Screenshots:

Microsoft Edge browser crashes:
Screen Shot 2019-12-20 at 11 29 18 AM

Firefox renders the page, but throws uncatchable error:
Screen Shot 2019-12-20 at 11 28 44 AM

Desired behavior

Make it possible to catch the error or handle indexedDB unsupported state

messaging needs-attention

Most helpful comment

Hi @alexiusp ,
@mmermerkaya has added the API support . Here is an example on how to use. Cheers.

All 5 comments

See related issue: https://github.com/firebase/firebase-js-sdk/issues/2373

As suggested in that issue, can you detect private mode and not initialize messaging if that's the case?

Otherwise @mmermerkaya is it worth it to find a way to throw a catchable error on trying to initialize messaging when there is no IndexedDB?

I'll see if I can add this to the isSupported() check.

See related issue: #2373

As suggested in that issue, can you detect private mode and not initialize messaging if that's the case?

Otherwise @mmermerkaya is it worth it to find a way to throw a catchable error on trying to initialize messaging when there is no IndexedDB?

If it is possible I would prefer catchable error. if not, then will try detecting private mode 馃憤

@mmermerkaya @hsubox76 any news on this topic? having a catchable error would be really appreciated.

Hi @alexiusp ,
@mmermerkaya has added the API support . Here is an example on how to use. Cheers.

Was this page helpful?
0 / 5 - 0 ratings