Open Bug 1679564 Opened 4 years ago Updated 2 years ago

autofill should dispatch change event AFTER JavaScript has finished executing

Categories

(Toolkit :: Password Manager, defect, P2)

Firefox 83
defect

Tracking

()

People

(Reporter: carlo.dellacqua97, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0

Steps to reproduce:

The autofill feature is dispatching the change event on input of type password, but not on input of type text or email.

To reproduce:

  1. create a simple webpage with a login form containing an input of type email and an input of type password
  2. attach change handlers to the input fileds
  3. attach a submit handler (which prevents the default submit behavior) to the form element
  4. fill the form and submit so that firefox will ask you to save the entered credentials
  5. reload the page so that firefox will autofill with the saved credentials
  6. verify that the change event only gets dispatched by the input of type password and not by the email/text input

Working demo:
https://cdellacqua.github.io/firefox-autofill-issue-demo/index.html

Actual results:

The change event does not fire on input of type email or text, but fires on input of type password when Firefox autofills a login form on page load.

This is due to the fact that, for security reasons, autofilled passwords are notified with the change event only after the user has interacted with the page, while plain-text fields are autofilled before any event handler is attached.

Expected results:

Firefox should autofill form fields AFTER all synchronous JavaScript has finished executing, thus giving the code time to attach event handlers to the elements

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Form Autofill
Product: Firefox → Toolkit

Possibly related issue: when the login form is empty and the Form Autofill has multiple credentials stored for the same domain, the change event is fired by Firefox Desktop when the user clicks on one of the suggested credentials, while it is NOT fired by Firefox for Android under the same conditions

I can reproduce this issue, move this bug to the right component.

Status: UNCONFIRMED → NEW
Component: Form Autofill → Password Manager
Ever confirmed: true

Changing severity to S3 because there is a workaround to this particular issue. We'll try to get this patched in the next release or two.

Severity: -- → S3
Priority: -- → P2
Blocks: 1755724
You need to log in before you can comment on or make changes to this bug.