Hip Tip: Password Manager

If you are using the Password Manager under Mozilla XUL / XPCOM, (Firefox or Thunderbird) be sure to follow this tip.

Whenever presenting a host to the API ( for addUser, removeUser, findPasswordEntry … ) be sure to avoid putting a trailing ‘/’ on the end of that URI. Othewise, you will just get to add the user, but you will never be able to remove the user (or find the user again.). Even if you try to remove the entry from the Password Manager, it will fail! Also, instead of an error which could lead you in the right direction, you will only get an NSERRORFAILURE (0x80004005) instead of a more helpful NSERRORINVALID_ARG (0x80070057L). I probably spent too much time on this, but hopefully it will save you some trouble.

Just so this get’s the proper tags, this is releated to: var passManager = Components.classes["@mozilla.org/passwordmanager;1"] .getService(Components.interfaces.nsIPasswordManagerInternal);

and

    var passManager = Components.classes["@mozilla.org/passwordmanager;1"]
                            .getService(Components.interfaces.nsIPasswordManager);

If this was helpful, then please spread some karma…. klik on one of the google ads on this page 🙂

This entry was posted in General. Bookmark the permalink.

Leave a Reply

Your email address will not be published.