Skip to content

Commit

Permalink
Merge pull request #288 from lftl/master
Browse files Browse the repository at this point in the history
Switch to new JSON backend when available
  • Loading branch information
pfn committed Jul 26, 2014
2 parents 87aee3e + 5d62df4 commit 336f24c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions passifox/modules/KeePassFox.jsm
Expand Up @@ -14,8 +14,15 @@ let EXPORTED_SYMBOLS = [ "KeePassFox" ];
function KeePassFox() {
XPCOMUtils.defineLazyGetter(this, "_mozStorage", function() {
let contract = "@mozilla.org/login-manager/storage/mozStorage;1";
let storage = Cc[contract].createInstance(Ci.nsILoginManagerStorage);
storage.init();
let storage;
if (typeof Cc[contract] == 'undefined') {
contract = "@mozilla.org/login-manager/storage/json;1";
storage = Cc[contract].createInstance(Ci.nsILoginManagerStorage);
storage.initialize();
} else {
storage = Cc[contract].createInstance(Ci.nsILoginManagerStorage);
storage.init();
}
return storage;
});
XPCOMUtils.defineLazyGetter(this, "_crypto", function() {
Expand Down

0 comments on commit 336f24c

Please sign in to comment.