Skip to content

Instantly share code, notes, and snippets.

@dipenparmar12
Last active April 18, 2020 09:13
Show Gist options
  • Save dipenparmar12/1723c7ead5533134c8692489b67b38d2 to your computer and use it in GitHub Desktop.
Save dipenparmar12/1723c7ead5533134c8692489b67b38d2 to your computer and use it in GitHub Desktop.
How to print out my passwords in Firefox?

There is no built-in feature for this. You can use a short script in Firefox's Browser Console tool to generate/export a list.

Preparation: Enable Advanced Features of the Browser Console

This needs to be done once:

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button promising to be careful or accepting the risk.

(2) In the search box above the list, type or paste DEVT and pause while the list is filtered

(3) Double-click the devtools.chrome.enabled preference to switch the value from false to true

If you plan to turn this off afterwards, you can keep this tab open.

Running the Script

(1) Select and copy the following script:

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);
}

(2) Open Firefox's separate Browser Console window using

"3-bar" menu button > Web Developer > Browser Console > (menu bar) Tools > Web Developer > Browser Console (Windows) Ctrl+Shift+j

(3) Paste the script next to the caret (») -- this is below any messages that appear in the console -- and press Enter to run it. If you use a Master Password, Firefox may require you to enter it now.

Firefox should list out your user names and passwords in CSV format for easy copy/pasting.

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