Permalink
Browse files

better check if export from chrome

  • Loading branch information...
Zak Kriner
Zak Kriner committed Nov 19, 2011
1 parent 8349487 commit 0f15ecad85fdfac3dbfbfecfd84c90435f5fa620
Showing with 4 additions and 5 deletions.
  1. +3 −4 javascript/import.js
  2. +1 −1 test/import.js
View
@@ -80,7 +80,6 @@ var RdfImporter = {
RdfImporter.loadDoc = function(rdf) {
var profiles = [],
defaultProfile = {},
fromChrome = false,
settings = {};
// check over every Description, but will ignore groups and anything without
@@ -133,14 +132,14 @@ RdfImporter.loadDoc = function(rdf) {
if(prof.rdf_about == 'http://passwordmaker.mozdev.org/defaults'){
defaultProfile = prof;
}else{
// chrome export sets rdf_about to CHROME0, CHROME1, etc.
if(prof.rdf_about.indexOf('CHROME') != -1){ fromChrome = true; }
profiles.push(prof);
}
}
});
// chrome export doesn't include /remotes section.
var fromChrome = rdf.indexOf('http://passwordmaker.mozdev.org/remotes') == -1;
// chrome -> chrome doesn't need "default" profile. would create duplicate.
if(!fromChrome){
profiles.unshift(defaultProfile);
View
@@ -4,7 +4,7 @@ var rdf_doc1 = null;
QUnit.testStart = function () {
localStorage.clear();
Settings.profiles = null;
rdf_doc1 = RdfImporter.loadDoc($($('#rdf1').val()));
rdf_doc1 = RdfImporter.loadDoc($('#rdf1').val());
}
test("parse global settings", function () {

0 comments on commit 0f15eca

Please sign in to comment.