Skip to content

Instantly share code, notes, and snippets.

@beaverb1ll
Forked from cmatskas/ExportChromePasswords.js
Last active January 18, 2017 12:00
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save beaverb1ll/3a0247b960841f44f319 to your computer and use it in GitHub Desktop.
Save beaverb1ll/3a0247b960841f44f319 to your computer and use it in GitHub Desktop.
ExportChromePasswords.js
var 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(){
decryptedRow += '"hostname","username","password","formSubmitURL","httpRealm","usernameField","passwordField"';
for(i=0; i<model.length; i++){
var item = pl.getListItemByIndex(i);
decryptedRow += '<br/>"http://'+model.array_[i].shownUrl+'","'+model.array_[i].username+'","'+item.childNodes[0].childNodes[2].childNodes[0].value+'","http://'+model.array_[i].origin+'"," "," "," "';
};
var newWindow = window.open("", "MsgWindow");
newWindow.document.write(decryptedRow);
}
,300);
@beaverb1ll
Copy link
Author

if no passwords are displayed, running it again should resolve the issue. If anyone knows how to fix this, Please do.

@JensCarlberg
Copy link

The problem is that "PasswordManager.requestShowPassword(i)" pops up a dialog box, and the passwords aren't available until it has been completed, while the setTimeout runs after 300ms regardless if the popup is done or not. Increase the timeout to give yourself time to enter your password.

Or run it twice, since the completed request is valid for a while and wont provoke a popup the second time.

@Marqin
Copy link

Marqin commented Sep 19, 2016

If it's not working also for you, here is updated version: https://gist.github.com/Marqin/0f0ff5bac7d3f6fee422cf68b0736370

Copy link

ghost commented Oct 28, 2016

thanks marqin !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment