Feb 20 2012
Last update:

Force Firefox to Save Your Password

Filed under: Software » Security, Web Browsers » Firefox,
 

Force Firefox to Save Paypal Password

Trying to login to Paypal, your bank or credit card account, airline website, Yahoo, MSN, or any number of other online sites and for some reason Firefox doesn't ask you if you want to save your password? So, you have to type it in every time you want to log in. We show you how to force it to remember your passwords.

As far as security is concerned, it's actually a good thing that Firefox doesn't allow you to save your password for these sites, given the prevalence of Firefox on public computers, such as those in libraries, schools, and airports. You wouldn't want someone to sit down behind you, after all, and be able to login to your credit card account with the click of a button.

 

LastPass

Newer versions of Firefox are disabling the auto-forcing of password saving for a good reason: security. Instead of meddling with Firefox settings, we recommend you try out the LastPass application. LastPass lets you save your passwords and login credentials securely (in the LastPass vault). You will be able to retrieve them (use them to auto-login) on any supported browser or device.

Firefox 4 and Up

For security purposes, the nsLoginManager.js file has been repacked in Firefox versions 4 and up, into a compressed file called omni.jar (a JAR file is a Java archived file). You can extract the nsLoginManager.js file by renaming the archive to omni.zip, or using 7-Zip or WinRAR (which have .jar extraction support). Next, make the edits below to nsLoginManager.js, and finally, repack it (recompress it) into omni.jar and restore the archived file to its original location. Restart Firefox. Please remember that modifications to core files like are done at your own risk - there's a reason the Mozilla development team has structured and compressed these files as they have, and re-enabling the auto-saving of passwords on certain sites could pose a security threat. 

Firefox 3.6 -3.9: Force Firefox To Remember Your Password

Any website that has the autocomplete attribute set to off will disable Firefox's ability to save your password. To have Firefox change/ ignore this setting, you can do the following:

  • Make sure there are no instances of Firefox running (press Ctr + Alt + Del and check the process manager for any instances of Firefox.exe).
  • Browse to the directory you have Firefox installed in (C:\Program Files\Mozilla), and edit the file nsLoginManager.js using Notepad or another text editor that won't add formatting to your file (Word won't work).
  • Search the file (Ctrl + F) for instances of "autocomplete". This should bring you to the following section of code:
    • /* _isAutoCompleteDisabled
    • * Returns true if the page requests autocomplete be disabled for the specified form input. */
    • _isAutoCompleteDisabled : function (element) {
      • if ( element && element.hasAttribute("autocomplete") && element.getAttribute("autocomplete").toLowerCase() == "off")
      • return true;
    • return false;
    • },
  • Change the value "off" to "xxx" and save your changes.
  • Relaunch Firefox.

Bookmarklet to Force Firefox to Save Your Password (For Firefox 3.5 and earlier)

It's important that you only use this on a computer you trust, such as your home computer. Here's how it works:

Need to Organize? Visit Shoeboxed.com (Affiliate)

 
  • Right-click on this link and save it as a bookmark: Force Firefox Save
  • The next time you're on a page that requires you to enter a password, and Firefox refuses to save it, simply load the saved bookmark while on the page, before entering your password.
    • You'll see a confirmation dialog with the following: Removed autocomplete=off from 1 form and from 2 form elements, and removed onsubmit from 3 forms. After you type your password and submit the form, the browser will offer to remember your password.
    • Next, simply login as normal. The difference is that this time, Firefox will offer to save your password. Next time you login, your username and password will fill in automatically

How Does the Force Password Save Bookmarklet Work?

Firefox (and other browsers) are setup so that websites can request the "autocomplete" (password saving functionality) feature to be turned off. That means, when you visit their website, you won't (by default) be able to save a password because of a setting change. Don't forget that this is a reliable security precaution - as mentioned, you don't want to override this setting on a computer you're not familiar with or that is in a public location.

The Force Password Save Bookmarklet (Javascript) Code

That bookmarklet that forces Firefox to turn the "autocomplete" setting back on for specific web pages is executed via Javascript, so your browser must support Javascript for this to work. For the technically minded, or those that are simply curious, here's the code used to make the Javascript bookmarklet:

javascript:(
function() {
  var ca,cea,cs,df,dfe,i,j,x,y;
  function n(i,what) {
    return i+" "+what+((i==1)?"":"s")
  }
  ca=cea=cs=0;
  df=document.forms;
  for(i=0;i<df.length;++i) {
    x=df[i];
    dfe=x.elements;
    if(x.onsubmit) {
      x.onsubmit="";
      ++cs;
    }
    if(x.attributes["autocomplete"]) {
      x.attributes["autocomplete"].value="on";
      ++ca;
    }
    for(j=0;j<dfe.length;++j) {
      y=dfe[j];
      if(y.attributes["autocomplete"]) {
        y.attributes["autocomplete"].value="on";++cea;
      }
    }
  }
  alert("Removed autocomplete=off from "+n(ca,"form")+" and from "+n(cea,"form   element")+", and removed onsubmit from "+n(cs,"form")+". After you type your password and submit the form, the browser will offer to remember your password.")
}
)();

How to Make Your Own Bookmarklet?

Bookmarklets are essentially snippets of Javascript code. Just like when you create a bookmark to a page, a URL is stored, and upon recall executed (so your browser is taken to that URL), with a bookmarklet, the URL is a snippet of Javascript. If you bookmark the bookmarklet (hence the name), upon recall the Javascript snippet is executed in your browser. So all you really need to do is copy and paste the above code into the URL field of a link, and you have your bookmarklet. Note that we've inserted tabs and spacing for readability - you may need to remove these (ie. consolidate space) to get the Javascript to work correctly.

Your rating: None Average: 2.6 (11 votes)
Your rating: None Average: 2.6 (11 votes)
Email this page PDF of this page Print this page
Leave a comment
(14)



Firefox 25.0 - bookmarklet worked

worked on my cell phone providers website with germna FF 25.0

thanks a lot!

You're welcome! Glad we could

You're welcome! Glad we could help you out and thank you for reading! 

Force Firefox to Accept Passwords ie Yahoo

The bookmarklet, "Force Firefox Save"  worked on Firefox 23 - August 2013

Thanks

Fails on MSN

I'm sorry to say, this fix does not save passwords for MSN on FF 9.0. It is quite annoying. I hoped it would save me the hassle of resetting every now and then. Could someone please provide a solution for this?

Thanks.

Is Password Manager really for security?

We spend entirely too much of our time and energy searching for ways to repair our Firefox Password Manager. Shouldn't we be asking "What gives 'them' the right to interfere in our security settings on our computers?" The password manager exists to protect our security. It does not exist for 'their' convenience.

The instructions below do not

The instructions below do not work in Firefox 10 & 11 beta ... nsLoginManager.js is in omni.ja, not omni.jar, and resetting the true to false in the nsLoginManager.js as instructed below has no effect. FF 10 & 11 beta still will not save passwords on sites that this nsLoginManager.js file would work with the true/false change in FF version 3.6.

For security purposes, the nsLoginManager.js file has been repacked in Firefox versions 4 and up, into a compressed file called omni.jar (a JAR file is a Java archived file). You can extract the nsLoginManager.js file by renaming the archive to omni.zip, or using 7-Zip or WinRAR (which have .jar extraction support). Next, make the edits below to nsLoginManager.js, and finally, repack it (recompress it) into omni.jar and restore the archived file to its original location. Restart Firefox.

Plugins are annoying

I would have to confirm that it is annoying that we need to alleviate our security concerns via third party software such as Last Pass or miscellaneous plugins to handle our passwords - that's absurd!

The ACTA days and widespread invigilation on the web stinks like hell!

This might be useful. I found

This might be useful.

I found this on another forum....so all of the credit goes to that person and the creator of this plug-in.

Saved password editor plugin for Firefox.

I'm using FF v10.02 at home & FF v10.02 ESR at my work.  Works good on most websites, but not all.

Best wishes...

.jar .jar - no no; .ja .ja - yes yes

omni.jar doesn't exist in Firefox 10, but the file omni.ja does.

Doesn't work

This method to force Firefox to save your password doesn't appear to work any longer in Firefox 10.

Newer versions of Firefox

Anyone having trouble getting this to work in newer versions of Firefox, we suggest you checkout the LastPass utility. It allows you to keep an encrypted database of logins across not only browsers but platforms (PC, smartphone, etc.) as well.

Failure

Does not work on FF 9.0.1. Is there a revised version that will force passwords to be saved in FF 9.0.1?

Ray

prius2010 at hotmail dot co dot uk

Doesn't work Firefox 3.6.6

I can't get this to work in FF 3.6.6. Is there something obvious I might be doing wrong?

Nice script

Nice script. Exactly what I need now. This code I need as well =)

The content of this field is kept private and will not be shown publicly.
 

We use this trick question to try and prevent automated spam comments.