[Pkg-mozext-commits] [greasemonkey] 11/19: Fix syncing of script storage.
David Prévot
taffit at moszumanska.debian.org
Sat Mar 21 02:50:58 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository greasemonkey.
commit 85ec7b06185a478dcf8ab55c559c4fea7353abe2
Author: Jim Black <jeblackiii at yahoo.com>
Date: Mon Mar 16 23:32:11 2015 -0700
Fix syncing of script storage.
Missing JSON.parse from GM_ScriptStorageBack changes was causing corruption of script values.
---
modules/sync.js | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/modules/sync.js b/modules/sync.js
index c724ba6..c4133c8 100644
--- a/modules/sync.js
+++ b/modules/sync.js
@@ -137,6 +137,12 @@ ScriptStore.prototype = {
var names = storage.listValues();
for (var i = 0, name = null; name = names[i]; i++) {
var val = storage.getValue(name);
+ try {
+ val = JSON.parse(val);
+ } catch (e) {
+ dump('JSON parse error? ' + uneval(e) + '\n');
+ continue;
+ }
record.cleartext.values[name] = val;
totalSize += name.length;
totalSize += val.length || 4; // 4 for number / bool (no length).
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git
More information about the Pkg-mozext-commits
mailing list