From 4443ad370e00db06334305e6223c3432c33ac992 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 13 Oct 2019 18:41:16 -0400 Subject: Catch error when trying to persist storage This happens on Firefox Mobile --- ext/bg/js/settings.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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(); -- cgit v1.2.3