Skip to content

Commit

Permalink
6801 catch insecure indexedDB access (firebase#6841)
Browse files Browse the repository at this point in the history
  • Loading branch information
abilicz authored and levino committed Dec 10, 2022
1 parent 2fae73b commit 3d13c07
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/three-glasses-judge.md
@@ -0,0 +1,5 @@
---
'@firebase/util': patch
---

Fix for third party window content that cannot access IndexedDB if the browser is set to never accept third party cookies on Firefox.
6 changes: 5 additions & 1 deletion packages/util/src/environment.ts
Expand Up @@ -140,7 +140,11 @@ export function isSafari(): boolean {
* @return true if indexedDB is supported by current browser/service worker context
*/
export function isIndexedDBAvailable(): boolean {
return typeof indexedDB === 'object';
try {
return typeof indexedDB === 'object';
} catch (e) {
return false;
}
}

/**
Expand Down

0 comments on commit 3d13c07

Please sign in to comment.