We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b4121f commit 6cc56c4Copy full SHA for 6cc56c4
packages/replay/src/util/hasSessionStorage.ts
@@ -2,5 +2,10 @@ import { WINDOW } from '../constants';
2
3
/** If sessionStorage is available. */
4
export function hasSessionStorage(): boolean {
5
- return 'sessionStorage' in WINDOW && !!WINDOW.sessionStorage;
+ try {
6
+ // This can throw, e.g. when being accessed in a sandboxed iframe
7
+ return 'sessionStorage' in WINDOW && !!WINDOW.sessionStorage;
8
+ } catch {
9
+ return false;
10
+ }
11
}
0 commit comments