From 54ae79c320056fb7a561c014420864853d8f3c6c Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Fri, 3 May 2019 00:58:06 +0200 Subject: [PATCH] Moving to storage.local instead of storage.sync, because our settings object is too big for chrome --- src/ext/lib/Settings.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ext/lib/Settings.js b/src/ext/lib/Settings.js index 3624d4c..f1040d1 100644 --- a/src/ext/lib/Settings.js +++ b/src/ext/lib/Settings.js @@ -128,12 +128,12 @@ class Settings { } } else if (currentBrowser.chrome) { const ret = new Promise( (resolve, reject) => { - chrome.storage.sync.get('uwSettings', (res) => resolve(res)); + chrome.storage.local.get('uwSettings', (res) => resolve(res)); }); return ret['uwSettings']; } else if (currentBrowser.edge) { const ret = new Promise( (resolve, reject) => { - browser.storage.sync.get('uwSettings', (res) => resolve(res)); + browser.storage.local.get('uwSettings', (res) => resolve(res)); }); return ret['uwSettings']; } @@ -146,9 +146,9 @@ class Settings { if (currentBrowser.firefox || currentBrowser.edge) { extensionConf.version = this.version; - return this.useSync ? browser.storage.sync.set( {'uwSettings': JSON.stringify(extensionConf)}): browser.storage.local.set( {'uwSettings': JSON.stringify(extensionConf)}); + return this.useSync ? browser.storage.local.set( {'uwSettings': JSON.stringify(extensionConf)}): browser.storage.local.set( {'uwSettings': JSON.stringify(extensionConf)}); } else if (currentBrowser.chrome) { - return chrome.storage.sync.set( {'uwSettings': JSON.stringify(extensionConf)}); + return chrome.storage.local.set( {'uwSettings': JSON.stringify(extensionConf)}); } }