From c9b3ea2f84ce8ab5f8cd56862825aba53947483b Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Sat, 6 Sep 2014 00:37:30 +0200 Subject: [PATCH] Adjust use of chrome.storage.managed for Opera It turns out that chrome.storage.managed is defined for Opera, so the previous feature detection method did not work. --- web/preferences.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/preferences.js b/web/preferences.js index 92f0dc648..88feabce2 100644 --- a/web/preferences.js +++ b/web/preferences.js @@ -204,11 +204,15 @@ var Preferences = { // // These preferences can be overridden by the user. // chrome.storage.managed.get(DEFAULT_PREFERENCES, getPreferences); // } else { -// // Managed storage not supported, e.g. in Opera. +// // Managed storage not supported, e.g. in old Chromium versions. // getPreferences(DEFAULT_PREFERENCES); // } // // function getPreferences(defaultPrefs) { +// if (chrome.runtime.lastError) { +// // Managed storage not supported, e.g. in Opera. +// defaultPrefs = DEFAULT_PREFERENCES; +// } // chrome.storage.local.get(defaultPrefs, function(readPrefs) { // resolve(readPrefs); // });