Skip to content

Commit 67d2ddf

Browse files
committed
Catch quota exceptions on Safari private browsing
1 parent 5e7e658 commit 67d2ddf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/StorageController.browser.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ var StorageController = {
1919
},
2020

2121
setItem(path: string, value: string) {
22-
localStorage.setItem(path, value);
22+
try {
23+
localStorage.setItem(path, value);
24+
} catch (e) {
25+
// Quota exceeded, possibly due to Safari Private Browsing mode
26+
}
2327
},
2428

2529
removeItem(path: string) {

0 commit comments

Comments
 (0)