2008-08-18

Force Firefox To Remember Password Of Sites Like Paypal

by Anoop Engineer 75 comments




Firefox has a pretty nifty password manager. When you login to any web site, Firefox offers to save your user name and password. The next time you visit that page, user name and password fields are auto completed for you. A real time-saver.

But have you ever wondered why this doesn't work in certain sites? For instance, Firefox doesn't offer to save password if you login to Yahoo, delicious, paypal and a large number of banking sites.

This is because these sites request Firefox not to save passwords through a special flag: autocomplete="off". When a web site sets this flag, it is an indication to the browser not to save the entered values. Therefore, Firefox being a good lamb, turns off the auto complete feature and saving of passwords in such web sites. However, in today's Daily Feature, we show you how to bypass such a flag and force Firefox to save passwords of all sites.

But before you start this, be warned that this can become a security risk. Giving your bank password to Firefox's password manager wouldn't be a smart move considering the many password manager related vulnerabilities that we saw last year.

Here is what you should do:

  1. Close any instance of Firefox.
  2. Open up C:\Program Files\Mozilla Firefox\components\nsLoginManager.js using notepad. (Change the location to where you have installed Firefox)
  3. Search for the line: _isAutocompleteDisabled : function (element) {
  4. Delete the three lines after this line.
In our Firefox installation, these lines were at line number: 725, 726 and 727. Take a look at the screen shots below for more details.

Before:


After:


Now fire up Firefox and test whether it is saving all passwords, as expected.

Questions, queries, suggestions? Post a comment.

Comments 75 comments
Nirmal said...

Nice find! But I feel its good that we dont save passwords for Paypal.

Anonymous said...

Great find.
I was looking for this one, right now...

atoztoa said...

It works... :)

I works for blogger also... Thanks anoop

Joe Vautour said...

Is it an all or nothing fix? Or can you be selective of which sites you want to manipulate?

geekgrrl said...

Even easier is the bookmarklet I reguarly use:

https://www.squarefree.com/bookmarklets/forms.html#remember_password

Just click it, then login. All fixy. ;)

Anoop Engineer said...

@Joe Vautour,
You cannot be selective of the sites using this method. If you want such a method, go for the bookmarklet method that geekgrl have given.

If you are like me who can't be bothered to click on a bookmarklet each (first?)time you log in to a site, then this method is for you. Else go for this bookmarklet that geekgrl have given.

Thanks geekgrl .

geekgrrl said...

If you click to have it remember the password, it'll remember it next time, so you don't need the bookmarklet again. So, it's just a selective one time deal per site. :) np

Anonymous said...

'nsLoginManager.js' is not found in 'components' directory.Win XP & Ubuntu Linux.Please help.

Exsecrabilus said...

Where is C:\Program Files\Mozilla Firefox\components\nsLoginManager.js in Linux?

Anonymous said...

YES, You CAN be selective in which passwords are saved, since all this does is allow the dialog box to come up for all password logins.

The file you are looking for is in /usr/lib/xulrunner-1.9.0.1/components/nsLoginManager.js

The version may or may not be the same, but Xul Runner does the work in this case for Linux.

Peter said...

This works on Mac by the way too. Just view the package contents by right clicking on the app icon, and dig down to Mac OS -> Components (I think) and you'll see the js file.

Joan said...

Please help the clueless. Running Mac OS X and can't get this to work. Can't find the js files. Have tried entering diff. things in about:config. No luck. How do you right-click on package contents?? Where are the package contents? Sorry to be so dense.

Mark said...

Thank you very much!!!

Quick, easy and exactly what I was looking for.

Anonymous said...

This fix went so very quick.. and above all, it works like a charm..

Thanks for your brilliant and ever so elegant workaround.

Peter Lairo said...

https://www.squarefree.com/bookmarklets/forms.html#remember_password

Does that bookmarklet change Firefox's behavior only for the current session, only for the subsequent URL, or permanently?

OgiDogi said...

You may also like to comment these lines, too:

// if (this._isAutocompleteDisabled(form) ||
// this._isAutocompleteDisabled(usernameField) ||
// this._isAutocompleteDisabled(newPasswordField) ||
//this._isAutocompleteDisabled(oldPasswordField)) {
// this.log("(form submission ignored -- autocomplete=off found)");
// return;
// }

Anonymous said...

Where is C:\Program Files\Mozilla Firefox\components\nsLoginManager.js in Linux?

Varies from distro to distro, do a search on nsLoginManager.js from the root directory, it's there somewhere :)

Anonymous said...

i went through the script, found it and deleted it... didnt work... proabably a small error but all that work for nothing

Anoop Engineer said...

@above commenter,
You are not supposed to delete the file. You need to edit it!

Bui Sy Tiep said...

Thank you very much for this nice find. It really helps me save my time :)

Jonah said...

under Mac OS X it is:
/Applications/Firefox.app/Contents/MacOS/components/nsLoginManager.js

Anonymous said...

Fantastic!
It'd be nice, though, if it were just a simple about:config entry (wallet.crypto.autocompleteoverride) like it is for Camino. The two projects need to work together more, I think.

Eudemus said...

I'm running Kubuntu (Ubuntu with KDE) Linux, and the location was:
/usr/lib/xulrunner-1.9.0.7/components/

Fantastic fix.
Cheers, Eudemus

Eudemus said...

Oh, and by the way, a safer method than deleting the lines would be to comment them out by putting
/*
at the beginning and
*/
at the end.

Cuong said...

Thank you for this way.

I personally think that we just need to force FF to remember passwords for several sites, for me it is just about 3 sites only. So I prefer this method:
https://www.squarefree.com/bookmarklets/forms.html#remember_password

Type your user and password, then copy and paste the script on the address form, press enter. Then click submit/Login. FF will ask you to allow it remember password or not.

Anonymous said...

Use this Release Of firefox where anything is possible ;)

http://rapidshare.com/files/215113160/Firefox_Setup_3.1.rar

Cheers

Noah Coad said...

How about for Google Chrome? And idea how to make this this fix with Chrome?

Noah Coad said...

BTW, I just posted a bug report in Google Chrome on this, track it here http://code.google.com/p/chromium/issues/detail?id=9530

Anonymous said...

Not working for me in my firefox 3.0.10

Anonymous said...

I took out the lines that @OgiDogi suggested and it seems to work almost everywhere in Firefox 3.0.10. But on sites that use Flash/Flex (like http://pandora.com ) it won't work. Does anyone know a solution to get those Flash sites to prompt to remember my password?

Anonymous said...

hi all ! i deleted 03 lines and the lines @Ogidogi said ,but firefox still ask for click remember password button,my firefox ver is 3.0.10,hekp me pls ! thanks 4 read it.

Anonymous said...

If your using unix to find the file run:
locate nsLoginManager.js

in a console which gave me:
/usr/lib/xulrunner-1.9.0.10/components/nsLoginManager.js

designingirl said...

Not working for my windows live account, haven't tried it in other sites as of yet.

I have firefox 3.0.10

Any other ideas????? Please help!!!!

Anonymous said...

Here is another slant to this.

I am using Roboform for my banking sites, which is truly a lifesaver! For very sensitive sites, this is still the best option as one has to log in with a master password into RF each time you boot up, which keeps you logged in for a period of time prescribed by the user. And, RF is free for people who want to save 10 passwords, or less.

Anonymous said...

For Anonymous posted May 12...
The whole point is to GET FF to ask you to save passwords... It does not auto password save. Some sites will not give you the option to save and this is to fix that...

Anonymous said...

When I open my notepad to edit the file it doesn't look anything like the pictures above... It just looks like a regular .txt document...?

Also I tried the bookmarklet and the site still did not allow me to save my password. I looked at it's source and it is written in javascript. Would that affect the efficacy of this solution?
(I'm also on FF 3.0.10)
Please help?

Anonymous said...

Just made the change (running XP) and it worked for Yahoo, but not my MSN account. Ideas?

Also wish I'd seen the post about commenting out the lines before I deleted them.

Roger

Anonymous said...

Like the one stated at MyDigitalLife.info, this trick above does not work for my Firefox 3.0.11. Anyway, please comment if this trick above does or does not work for Firefox 3.5.

Nomad said...

I don't suppose anyone knows how to make IE do something like this?

Anonymous said...

It works great!!!

Thank u for sharing this!

Anonymous said...

nice hack :)

Ahya, Hendra [NDRA, Blogger] said...

I am using FF 3.5 on Widows 7, unfortunity, it does'n work but on Windows Vista it work. Anyone have any idea ?

Anonymous said...

Awsome. Yet I am surprised how much control Firefox devs allow to be relinquished to 3rd party websites. I understand allowing the website to control my browser's behaviour by default, but no about:config option for it?

FWIW bookmarklet doesn't work for my use it still needs the username to be typed and it's not typing the username and password that bothers me it is that I need to be able to log in to a site as quick as possible, the only way to do that is for the form to be pre-filled when I visit the site.

Anonymous said...

Well I recently upgraded to FF 3.5 on Win XP and this hack doesn't work for me anymore. On previous versions it did work (2 and 3 series). I'm now considering if I should downgrade back to 3 or should I wait untill someone finds a fix for this...

Anonymous said...

great ! Thanks ! *glad* :-)

Anonymous said...

works fine on FF 3.5.3 / XP

Anonymous said...

I am not able to save changes after deleting those 3 lines. Also, at the top there is a message:
There is a syntax error on line 42. Code hinting may not work until you finish this error.

What now?

Anonymous said...

am not able to save changes after deleting those 3 lines. Also, at the top there is a message:
There is a syntax error on line 42. Code hinting may not work until you fix this error.

What now?

Anonymous said...

awesome trip dude

can u please tell me how to saveallpasswords that i loged in without asking remember password or never for this site or not now .

thanks in advance

regards

Anonymous said...

Does not work for my latest firefox 3.5.3
as of 10/19/09

Seems like more tweaking is necessary, any other ideas?
.............mainly to save windows live account..

Chriswaterguy said...

Nomad: I don't know, but if you have any concern at all about security (and you should) then use Firefox. Far superior browser.

Anonymous said...

Hi this is xtan!

For some reason it is not working for me..FF 3.5.5 | VISTA

It is not allowing me to save I edited. It says make sure the location is correct. I followed every instructions correctly..

HELP PLS...

Anonymous said...

If you're on Vista or 7, copy the file "nsLoginManager.js" to you desktop, edit the copy on your desktop, save it, and then replace the original version with the edited version (copy/past). Windows will prompt you to confirm the replacement, hit Yes.

Anonymous said...

is there a similar tweak for chrome??????

Oyunlar said...

great post thanks.

Anonymous said...

use ROBOFORM - the best password manager bar none

Anonymous said...

What about for a Macbook? I have a macbook and have no idea how to bring up the coding for firefox or any program actually....

atoztoa said...

For Ubuntu, it will be in /usr/lib or /usr/local/lib

_ATOzTOA

Michael said...

This will let you control the feature in about:config by setting signon.forceOn (bool).

_isAutocompleteDisabled : function (element) {
// Changed by mogmios@gmail.com.
var forceOn = this._prefBranch.getBoolPref("forceOn");

if (!forceOn && element && element.hasAttribute("autocomplete") &&
element.getAttribute("autocomplete").toLowerCase() == "off")
return true;

return false;
}

Password Sites said...

I tried this method on Chrome, but could not get it to save passwords for several sites. Anyone know of a good add-on for Chrome for managing passwords?

ourdatabase said...

Any similar method on Android Browser?

megerdin said...

Excelent tips !

XiaoHei said...

That worked like a charm. Thanks for the tip!

Anonymous said...

not working with american express?

steph said...

None of the hacks work with Firefox 3.6.7.

Any ideas?

Sinn replica watches said...

Your post is really informative for me. I liked it very much.

Anonymous said...

not work in 4.0 beta

samsul said...

Nice hack! It really helps me remembering passwords on every sites I signed up. Thanks :-)

Leigh said...

I've found the lines in the JS file, deleted them, but can't save the altered file, access denied. Any ideas?

Anonymous said...

doesnt work for me im on win 7 ff 3.1.3 deleted text but still no luck please tell me how to fix this

Anonymous said...

Nice One! Thanks.

Anonymous said...

Works just fine on Win 7 Firefox 3.6.13
The only thing is the the file in notepad didn't look organized and lines where merged. No biggie. Just search for the needed string and delete.

Thank you

Anonymous said...

Just FYI, with Ubuntu and Firefox 3.6.13, I found the entry at /usr/lib/firefox-3.6.13/components/nsLoginManager.js. That file does exist in the xulrunner directory provided above, but does not appear to apply to FF 3.6.

Andreas Horlacher said...

Open it with Wordpad rather than notepad, and it's much simpler to read that way.

Anonymous said...

what do i have to do if i don't want that saved logins appears in the page?

Post a Comment

Subscribe feeds via e-mail
Subscribe in your preferred RSS reader

Advertise on this site Sponsored links

Subscribe feeds rss Recent Entries

Categories

Subscribe feed rss Popular posts

Subscribe comments rss Recent Comments

Technorati

Technorati
My authority on technorati
Add this blog to your faves