Skip to content

Commit c20633e

Browse files
authored
6801 catch insecure indexedDB access (#6841)
1 parent 7e237cd commit c20633e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.changeset/three-glasses-judge.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/util': patch
3+
---
4+
5+
Fix for third party window content that cannot access IndexedDB if the browser is set to never accept third party cookies on Firefox.

packages/util/src/environment.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,11 @@ export function isSafari(): boolean {
140140
* @return true if indexedDB is supported by current browser/service worker context
141141
*/
142142
export function isIndexedDBAvailable(): boolean {
143-
return typeof indexedDB === 'object';
143+
try {
144+
return typeof indexedDB === 'object';
145+
} catch (e) {
146+
return false;
147+
}
144148
}
145149

146150
/**

0 commit comments

Comments
 (0)