Force Firefox to Save Your Password

When you purchase through links on our site, we may earn a commission. Here’s how it works.

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:

  • Right-click on this link and save it as a bookmark: (Note: the extension “Force Firefox Save” has been removed by the author)
  • 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
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.

Tagged With: ,

The information provided through this website should not be used to diagnose or treat a health problem or disease; it is not intended to offer any legal opinion or advice or a substitute for professional safety advice or professional care. Please consult your health care provider, attorney, or product manual for professional advice. Products and services reviewed are provided by third parties; we are not responsible in any way for them, nor do we guarantee their functionality, utility, safety, or reliability. Our content is for educational purposes only.

Subscribe
Notify of
20 Comments
Newest
Oldest Most voted
Inline Feedbacks
View all comments