Skip to content

Commit

Permalink
Added Filevault workaround. Closes #9.
Browse files Browse the repository at this point in the history
  • Loading branch information
codebutler committed Jan 30, 2011
1 parent 0b401ec commit a50e9fa
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion xpi/modules/Firesheep.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,22 @@ var Firesheep = {
} else {
file.append("firesheep-backend");
}


// Hack for filevault
var osString = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).OS;
if (osString == 'Darwin') {
var username = Utils.runCommand('whoami', []).trim();
var vaultFile = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
vaultFile.initWithPath("/Users/." + username + "/" + username + ".sparsebundle");
if (vaultFile.exists()) {
var tmpFile = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
tmpFile.initWithPath("/tmp/firesheep-backend");
if (!tmpFile.exists())
file.copyTo(tmpFile.parent, tmpFile.leafName);
return tmpFile.path;
}
}

return file.path;
},

Expand Down

0 comments on commit a50e9fa

Please sign in to comment.