From 72714160bbab906ad027706e8a930b3c2f27f74c Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 5 Nov 2017 06:13:51 +0300 Subject: [PATCH] storage: fallback on any IndexedDB-related failure --- background/storage.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/background/storage.js b/background/storage.js index fe8a222b..6f1098d3 100644 --- a/background/storage.js +++ b/background/storage.js @@ -117,7 +117,9 @@ do { chromeLocal.get('dbInChromeStorage') .then(data => data && data.dbInChromeStorage && Promise.reject()) - .then(() => dbExecIndexedDB('getAllKeys', IDBKeyRange.lowerBound(1), 1)) + .then(() => + tryCatch(dbExecIndexedDB, 'getAllKeys', IDBKeyRange.lowerBound(1), 1) || + Promise.reject()) .then(({target}) => ( (target.result || [])[0] ? Promise.reject('ok') :