Skip to content

Commit

Permalink
6801 catch insecure indexedDB access (#6841)
Browse files Browse the repository at this point in the history
  • Loading branch information
abilicz authored Dec 1, 2022
1 parent 7e237cd commit c20633e
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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 c20633e

Please sign in to comment.