Autofill#
Defines commands and events for Autofill.
This CDP domain is experimental.
Types#
Generally, you do not need to instantiate CDP types yourself. Instead, the API creates objects for you as return values from commands, and then you can use those objects as arguments to other commands.
- class AddressField(name, value)[source]#
-
name:
str# 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
-
name:
- class AddressFields(fields)[source]#
A list of address fields.
-
fields:
List[AddressField]#
-
fields:
- class Address(fields)[source]#
-
fields:
List[AddressField]# fields and values defining an address.
-
fields:
- class AddressUI(address_fields)[source]#
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
-
address_fields:
List[AddressFields]# A two dimension array containing the representation of values from an address profile.
-
address_fields:
- class FillingStrategy(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Specified whether a filled field was done so by using the html autocomplete attribute or autofill heuristics.
- AUTOCOMPLETE_ATTRIBUTE = 'autocompleteAttribute'#
- AUTOFILL_INFERRED = 'autofillInferred'#
- class FilledField(html_type, id_, name, value, autofill_type, filling_strategy, frame_id, field_id)[source]#
-
-
filling_strategy:
FillingStrategy# The filling strategy
-
field_id:
BackendNodeId# The form field’s DOM node
-
filling_strategy:
Commands#
Each command is a generator function. The return
type Generator[x, y, z] indicates that the generator
yields arguments of type x, it must be resumed with
an argument of type y, and it returns type z. In
this library, types x and y are the same for all
commands, and z is the return type you should pay attention
to. For more information, see
Getting Started: Commands.
- set_addresses(addresses)[source]#
Set addresses so that developers can verify their forms implementation.
- trigger(field_id, frame_id=None, card=None, address=None)[source]#
Trigger autofill on a form identified by the fieldId. If the field and related form cannot be autofilled, returns an error.
- Parameters:
field_id (
BackendNodeId) – Identifies a field that serves as an anchor for autofill.frame_id (
Optional[FrameId]) – (Optional) Identifies the frame that field belongs to.card (
Optional[CreditCard]) – (Optional) Credit card information to fill out the form. Credit card data is not saved. Mutually exclusive with`address``.address (
Optional[Address]) – (Optional) Address to fill out the form. Address data is not saved. Mutually exclusive with``card`.
- Return type:
Events#
Generally, you do not need to instantiate CDP events yourself. Instead, the API creates events for you and then you use the event’s attributes.
- class AddressFormFilled(filled_fields, address_ui)[source]#
Emitted when an address form is filled.
-
filled_fields:
List[FilledField]# Information about the fields that were filled
-
filled_fields: