summaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-13 18:41:16 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-13 18:41:16 -0400
commit4443ad370e00db06334305e6223c3432c33ac992 (patch)
treeb881b7501c6c78293ef2c1192076423f6036d932 /ext/bg
parent693ffebbf77853d482dbe0e58f8363212ece809e (diff)
Catch error when trying to persist storage
This happens on Firefox Mobile
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/settings.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/bg/js/settings.js b/ext/bg/js/settings.js
index dc8c2690..1eed766c 100644
--- a/ext/bg/js/settings.js
+++ b/ext/bg/js/settings.js
@@ -920,7 +920,14 @@ async function storagePersistInitialize() {
if (persisted) {
return;
}
- if (await navigator.storage.persist()) {
+ let result = false;
+ try {
+ result = await navigator.storage.persist();
+ } catch (e) {
+ // NOP
+ }
+
+ if (result) {
persisted = true;
checkbox.checked = true;
storageShowInfo();