Autofill

class Autofill(cdp: CDP) : Domain

Defines commands and events for Autofill.

Constructors

Link copied to clipboard
constructor(cdp: CDP)

Types

Link copied to clipboard
@Serializable
data class Address(val fields: List<Autofill.AddressField>)
Link copied to clipboard
@Serializable
data class AddressField(val name: String, val value: String)
Link copied to clipboard
@Serializable
data class AddressFields(val fields: List<Autofill.AddressField>)

A list of address fields.

Link copied to clipboard
@Serializable
data class AddressFormFilledParameter(val filledFields: List<Autofill.FilledField>, val addressUi: Autofill.AddressUI)

Emitted when an address form is filled.

Link copied to clipboard
@Serializable
data class AddressUI(val addressFields: List<Autofill.AddressFields>)

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

Link copied to clipboard
@Serializable
data class CreditCard(val number: String, val name: String, val expiryMonth: String, val expiryYear: String, val cvc: String)
Link copied to clipboard
@Serializable
data class FilledField(val htmlType: String, val id: String, val name: String, val value: String, val autofillType: String, val fillingStrategy: Autofill.FillingStrategy, val frameId: String, val fieldId: Int)
Link copied to clipboard

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

Link copied to clipboard
@Serializable
data class SetAddressesParameter(val addresses: List<Autofill.Address>)
Link copied to clipboard
@Serializable
data class TriggerParameter(val fieldId: Int, val frameId: String? = null, val card: Autofill.CreditCard)

Properties

Link copied to clipboard

Emitted when an address form is filled.

Functions

Link copied to clipboard
suspend fun disable(mode: CommandMode = CommandMode.DEFAULT)

Disables autofill domain notifications.

Link copied to clipboard
suspend fun enable(mode: CommandMode = CommandMode.DEFAULT)

Enables autofill domain notifications.

Link copied to clipboard
suspend fun setAddresses(addresses: List<Autofill.Address>)
suspend fun setAddresses(args: Autofill.SetAddressesParameter, mode: CommandMode = CommandMode.DEFAULT)

Set addresses so that developers can verify their forms implementation.

Link copied to clipboard
suspend fun trigger(args: Autofill.TriggerParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun trigger(fieldId: Int, frameId: String? = null, card: Autofill.CreditCard)

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