Closed Bug 936026 Opened 11 years ago Closed 5 years ago

Password fields not re-filled and login autocomplete not attached after back/forward navigation

Categories

(Toolkit :: Password Manager, defect, P1)

24 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox-esr52 --- wontfix
firefox-esr60 --- wontfix
firefox54 --- wontfix
firefox55 --- wontfix
firefox56 --- wontfix
firefox66 --- wontfix
firefox67 --- wontfix
firefox68 --- fixed

People

(Reporter: u426980, Assigned: MattN)

References

Details

(Keywords: regression, reproducible, testcase, Whiteboard: [passwords:fill-ui] )

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0 (Beta/Release)
Build ID: 20131025151332

Steps to reproduce:

1. Go to a page with a login form (ie. reddit.com). 
2. Go to any other page afterward.
3. Press "back" button, use mouse-button, or keyboard shortcut to go back.


Actual results:

Username is filled in but not password.


Expected results:

Username and password should be filled in.
I don't tink it's valid for any login form.

I tried on a phpBB forum and login/password are filled after clicking on "back".
Component: Untriaged → Password Manager
Product: Firefox → Toolkit
Summary: Password field not filled when using back/forward actions. → Password field not filled on reddit.com when using back/forward actions.
I can reproduce this on Nightly and I have a testcase I will upload.

My understanding is that browsers don't save the password state upon navigation as it would make it possible for people to retrieve a password from a login form by going back in history. If the password is saved in the password manager and autofill is enabled, then we could re-fill the password field in this case. 

DOMFormHasPassword doesn't fire again in the normal case (and I don't think that would be expected) but we could listen for the "pageshow" event and call LoginManagerContent.onContentLoaded after modifying it to check event.persisted and work with useDOMFormHasPassword.

I couldn't find another bug on this but I have a hard time believing this is the first report.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 8.1 → All
Hardware: x86_64 → All
Summary: Password field not filled on reddit.com when using back/forward actions. → Password fields not re-filled after back/forward navigation
Whiteboard: [DUPEME]
Attached file Testcase
Keywords: testcase
Version: 25 Branch → Trunk
Flags: firefox-backlog?
See bug 946549 comment 3 for a method which could be used for this.
Flags: firefox-backlog? → firefox-backlog+
While investigating bug 1378754, I realized that the cause of this was the removal of the STATE_RESTORING progress listener handling[1] in bug 839961. The onStateChange handler was simply replaced with a DOMContentLoaded listener but that doesn't handle this case coming from bfcache.

-            // Fastback doesn't fire DOMContentLoaded, so process forms now.
-            if (aStateFlags & Ci.nsIWebProgressListener.STATE_RESTORING) {
-                log("onStateChange: restoring document");
-                return this._pwmgr._fillDocument(domDoc);
-            }

Since _fillDocument also handled markAsLoginManagerField and nsFormFillController clears the hash table of marked login manager fields upon pagehide, this change also broke login autocompletion while navigating in session history.

[1] https://hg.mozilla.org/mozilla-central/rev/58d5552a5ef4#l4.174
Blocks: 839961
Severity: normal → major
Priority: -- → P1
See Also: → 1378754
Summary: Password fields not re-filled after back/forward navigation → Password fields not re-filled and login autocomplete not attached after back/forward navigation
Whiteboard: [DUPEME]
Version: Trunk → 24 Branch
We really need a test for both broken things upon session history navigation:
* auto-filling with one matching login
* autocompletion on the username field
Flags: in-testsuite?
Moving to p3 because no activity for at least 24 weeks.
Priority: P1 → P3
Priority: P3 → P1
Whiteboard: [passwords:fill-ui]

The autocomplete portion was handled by bug 1378754 but we should still add a test for it. Autofill should still be affected.

Depends on: 1378754

Taking this since this is related to the progress listeners in bug 1287202.

Assignee: nobody → MattN+bmo
Status: NEW → ASSIGNED
Pushed by mozilla@noorenberghe.ca:
https://hg.mozilla.org/integration/autoland/rev/e4044386c8ae
Autofill login forms after restoring documents from bfcache. r=jaws
https://hg.mozilla.org/integration/autoland/rev/d06cbdecb389
Test autofilling logins in documents restored from bfcache. r=jaws
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Pushed by mozilla@noorenberghe.ca:
https://hg.mozilla.org/integration/autoland/rev/4ce441f87fdf
Autofill login forms after restoring documents from bfcache. r=jaws
https://hg.mozilla.org/integration/autoland/rev/48cd73fc0893
Test autofilling logins in documents restored from bfcache. r=jaws
Flags: needinfo?(MattN+bmo)
Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: