Closed Bug 1863801 Opened 11 months ago Closed 10 months ago

Infer form submission after DOMDocFetchSuccess event and form removal in FormAutofill

Categories

(Toolkit :: Form Autofill, task)

task

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: janika, Assigned: janika)

References

Details

Attachments

(6 files)

We also want to capture addresses that are submitted by a fetch or xhr request instead of a standard form submission event. Usually as a next step after a successful fetch or xhr request, the address form is removed from the DOM.

The two implementation steps are:

  • P1. Add a listener for the DOMDocFetchSuccess event when the user focuses in an address field
  • P2. Infer form submission when the address form is removed
Blocks: 1835769
Attachment #9362666 - Attachment description: Bug 1863801 - P1. Add DOMDocFetchSuccess event listener when the user focuses in an address or cc field r=dimi! → Bug 1863801 - P1. Add DOMDocFetchSuccess event listener when the user interacts with address or cc field r=dimi!

Test that we infer a form submission after a successful xhr/fetch request followed by a form removal.
Then the address fields are captured and stored.

Depends on D193633

Attachment #9364749 - Attachment description: Bug 1863801 - Add preference extensions.formautofill.heuristics.captureOnFormRemoval r=dimi! → Bug 1863801 - P5. Add preference extensions.formautofill.heuristics.captureOnFormRemoval r=dimi!
Attachment #9364749 - Attachment description: Bug 1863801 - P5. Add preference extensions.formautofill.heuristics.captureOnFormRemoval r=dimi! → Bug 1863801 - P4. Add preference extensions.formautofill.heuristics.captureOnFormRemoval r=dimi!
Attachment #9364739 - Attachment description: Bug 1863801 - P4. Add test case r=dimi! → Bug 1863801 - P5. Add test for address capture for form removal heuristic r=dimi!

In P1 to P4 the FormAutofill starts listening to the DOMDocFetchSuccess event to detect form submissions.
FormAutofill and LoginManager will both use SetNotifyFetchSuccess to initiate the document to fire the event.
The LoginManager now manually adds the event listener, instead of always listening and acting on it.
This prevents interference between the LoginManager and FormAutofill.

Attachment #9365386 - Attachment description: Bug 1863801 - P0. Register the event listener for the DOMDocFetchSuccess event manually in LoginManager r=dimi! → Bug 1863801 - P0. Register the event listener for the DOMDocFetchSuccess by calling addEventListener in LoginManagerChild r=dimi!
Pushed by jneuberger@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/31e08bae4ce6 P0. Register the event listener for the DOMDocFetchSuccess by calling addEventListener in LoginManagerChild r=dimi https://hg.mozilla.org/integration/autoland/rev/5f6ad20da89e P1. Add DOMDocFetchSuccess event listener when the user interacts with address or cc field r=dimi https://hg.mozilla.org/integration/autoland/rev/dd78261ec1d8 P2. Add DOMFormRemoved event listener after successful fetch or XHR request r=dimi https://hg.mozilla.org/integration/autoland/rev/193d5c08a17f P3. Infer a form submission after DOMFormRemoved event r=dimi https://hg.mozilla.org/integration/autoland/rev/8d297207efc7 P4. Add preference extensions.formautofill.heuristics.captureOnFormRemoval r=dimi https://hg.mozilla.org/integration/autoland/rev/c27de56bd433 P5. Add test for address capture for form removal heuristic r=dimi
Pushed by jneuberger@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4b0e2e4d652a P0. Register the event listener for the DOMDocFetchSuccess by calling addEventListener in LoginManagerChild r=dimi https://hg.mozilla.org/integration/autoland/rev/72f0587fda19 P1. Add DOMDocFetchSuccess event listener when the user interacts with address or cc field r=dimi https://hg.mozilla.org/integration/autoland/rev/d6e17dcf00a4 P2. Add DOMFormRemoved event listener after successful fetch or XHR request r=dimi https://hg.mozilla.org/integration/autoland/rev/157fc7d2c5da P3. Infer a form submission after DOMFormRemoved event r=dimi https://hg.mozilla.org/integration/autoland/rev/12253bf8fb88 P4. Add preference extensions.formautofill.heuristics.captureOnFormRemoval r=dimi
Flags: needinfo?(jneuberger)
Pushed by jneuberger@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9004e2d6ae97 P5. Add test for address capture for form removal heuristic r=dimi
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: