Autofill

Experimental

Defines commands and events for Autofill.

Commands

Autofill.trigger

Trigger autofill on a form identified by the fieldId.
If the field and related form cannot be autofilled, returns an error.

Parameters
Name Type Description
fieldId DOM.BackendNodeId Identifies a field that serves as an anchor for autofill.
frameId (optional) Page.FrameId Identifies the frame that field belongs to.
card (optional) CreditCard Credit card information to fill out the form. Credit card data is not saved. Mutually exclusive with `address`.
address (optional) Address Address to fill out the form. Address data is not saved. Mutually exclusive with `card`.

Autofill.setAddresses

Set addresses so that developers can verify their forms implementation.

Parameters
Name Type Description
addresses array<Address>

Autofill.disable

Disables autofill domain notifications.

Autofill.enable

Enables autofill domain notifications.

Events

Autofill.addressFormFilled

Emitted when an address form is filled.

Parameters
Name Type Description
filledFields array<FilledField> Information about the fields that were filled
addressUi AddressUI An UI representation of the address used to fill the form.
Consists of a 2D array where each child represents an address/profile line.

Types

CreditCard

(object)
Properties
Name Type Description
number string 16-digit credit card number.
name string Name of the credit card owner.
expiryMonth string 2-digit expiry month.
expiryYear string 4-digit expiry year.
cvc string 3-digit card verification code.

AddressField

(object)
Properties
Name Type Description
name string address field name, for example GIVEN_NAME.
The full list of supported field names:
https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/field_types.cc;l=38
value string address field value, for example Jon Doe.

AddressFields

(object)

A list of address fields.

Properties
Name Type Description
fields array<AddressField>

Address

(object)
Properties
Name Type Description
fields array<AddressField> fields and values defining an address.

AddressUI

(object)

Defines how an address can be displayed like in chrome://settings/addresses.
Address UI is a two dimensional array, each inner array is an "address information line", and when rendered in a UI surface should be displayed as such.
The following address UI for instance:
[[{name: "GIVE_NAME", value: "Jon"}, {name: "FAMILY_NAME", value: "Doe"}], [{name: "CITY", value: "Munich"}, {name: "ZIP", value: "81456"}]]
should allow the receiver to render:
Jon Doe
Munich 81456

Properties
Name Type Description
addressFields array<AddressFields> A two dimension array containing the representation of values from an address profile.

FillingStrategy

(string)

Specified whether a filled field was done so by using the html autocomplete attribute or autofill heuristics.

Allowed Values
  • autocompleteAttribute
  • autofillInferred

FilledField

(object)
Properties
Name Type Description
htmlType string The type of the field, e.g text, password etc.
id string the html id
name string the html name
value string the field value
autofillType string The actual field type, e.g FAMILY_NAME
fillingStrategy FillingStrategy The filling strategy
frameId Page.FrameId The frame the field belongs to
fieldId DOM.BackendNodeId The form field's DOM node

Summary