Skip to content

Instantly share code, notes, and snippets.

@jscher2000
Created September 18, 2018 03:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jscher2000/06e6e7487c5bd656040ce333e791a416 to your computer and use it in GitHub Desktop.
Save jscher2000/06e6e7487c5bd656040ce333e791a416 to your computer and use it in GitHub Desktop.
Dump Firefox Logins as CSV to Browser Console
// Run code in Browser Console after enabling Chrome Debugging --
// about:config => devtools.chrome.enabled => true
try {
signons = Services.logins.getAllLogins();
var csv = '"Site","Username","Password"';
for (var i=0; i<signons.length; i++){
csv += '\n';
csv += signons[i].httpRealm ?
('"' + signons[i].hostname + ' (' + signons[i].httpRealm + ')","') :
'"' + signons[i].hostname + '","';
csv += signons[i].username + '","' + signons[i].password + '"';
}
console.log(csv);
} catch (err) {
console.log('Problem reading or outputting logins: '+err);
}
@jscher2000
Copy link
Author

Developed in response to this support issue:

https://support.mozilla.org/questions/1234268

If you test it out, please report back on any glitches.

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