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.
This commit is contained in:
Rob Wu 2014-09-06 00:37:30 +02:00
parent 1d9dc37337
commit c9b3ea2f84

View File

@ -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);
// });