Skip to content

Commit

Permalink
Fixed initialization issue on Chromium
Browse files Browse the repository at this point in the history
- Check for uninitialized idlist value in local storage
- Updated extension version in manifest
  • Loading branch information
andrew-tpfc committed Jul 15, 2014
1 parent 3313e1c commit d871995
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
18 changes: 10 additions & 8 deletions chrome/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ var vault = {
return;
}
try {
chrome.storage.local.get('idlist', function(retval) {
vault.tmplist = retval.idlist;
for (var id in vault.tmplist) {
if (!vault.tmplist[id].keytext.match(/^pgid-uid:\s+(.*)$/m)) {
callback(true);
return;
chrome.storage.local.get(null, function(retval) {
if (retval.idlist !== undefined) {
vault.tmplist = retval.idlist;
for (var id in vault.tmplist) {
if (!vault.tmplist[id].keytext.match(/^pgid-uid:\s+(.*)$/m)) {
callback(true);
return;
}
}
idlist = vault.tmplist;
}
idlist = vault.tmplist;
callback(false);
});
} catch(err) {
Expand All @@ -61,7 +63,7 @@ var vault = {
return true;
},
add: function(uid, dspname, keytext) {
idlist[uid] = { name: dspname, keytext: keytext};
idlist[uid] = { name: dspname, keytext: keytext };
persistStore();
},
remove: function(uid) {
Expand Down
8 changes: 3 additions & 5 deletions chrome/manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"manifest_version" : 2,
"name" : "Pretty Good ID",
"description" : "Pretty Good ID - Chrome Extension - Basic",
"version" : "0.1",
"description" : "Pretty Good ID",
"version" : "0.2.1",

"background" : {
"scripts" : [
Expand All @@ -29,7 +29,5 @@

"web_accessible_resources" : [ "options.html" ],

"permissions" : [
"storage"
]
"permissions" : [ "storage" ]
}

0 comments on commit d871995

Please sign in to comment.