Skip to content

Instantly share code, notes, and snippets.

@antonyh
Forked from walalm/GoogleChromePasswordExport.js
Last active October 27, 2016 19:54
Show Gist options
  • Save antonyh/fce13fc95acc800ffb38856089d28b6d to your computer and use it in GitHub Desktop.
Save antonyh/fce13fc95acc800ffb38856089d28b6d to your computer and use it in GitHub Desktop.
Export Chrome passwords in a format importable into Enpass
# Produces output (hopefully) compatible with Enpass
var decryptedRow="";
decryptedRow="";
var pm = PasswordManager.getInstance();
var model = pm.savedPasswordsList_.dataModel;
var pl = pm.savedPasswordsList_;
for(i=0;i<model.length;i++){
PasswordManager.requestShowPassword(i);
};
setTimeout(function(){
for(i=0; i<model.length; i++){
var item = pl.getListItemByIndex(i);
//console.log(model);
decryptedRow += model.array_[i].shownOrigin+'",username,"'+model.array_[i].username+'",password,"'+item.childNodes[0].childNodes[2].childNodes[0].value+'",url,"'+model.array_[i].url+'",Imported from Chrome<br/>';
};
var newWindow = window.open("", "MsgWindow");
newWindow.document.write(decryptedRow);
}
,1000);
//If you have any trouble or UNDEFINED data in your exported list re-run this script again until the UNDEFINED data is gone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment