[Pkg-javascript-commits] [pdf.js] 42/204: Adjust use of chrome.storage.managed for Opera
David Prévot
taffit at moszumanska.debian.org
Sat Oct 25 18:50:28 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit c9b3ea2f84ce8ab5f8cd56862825aba53947483b
Author: Rob Wu <rob at robwu.nl>
Date: Sat Sep 6 00:37:30 2014 +0200
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 92f0dc6..88feabc 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);
// });
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
More information about the Pkg-javascript-commits
mailing list