autofill

package
v0.157.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package autofill provides the Chrome DevTools Protocol commands, types, and events for the Autofill domain.

Defines commands and events for Autofill.

Generated by the pdlgen command.

Index

Constants

View Source
const (
	CommandTrigger      = "Autofill.trigger"
	CommandSetAddresses = "Autofill.setAddresses"
	CommandDisable      = "Autofill.disable"
	CommandEnable       = "Autofill.enable"
)

Command names.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Fields []*AddressField `json:"fields"` // fields and values defining an address.
}

Address [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#type-Address

type AddressField

type AddressField struct {
	Name  string `json:"name"`  // 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 `json:"value"` // address field value, for example Jon Doe.
}

AddressField [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#type-AddressField

type AddressFields

type AddressFields struct {
	Fields []*AddressField `json:"fields"`
}

AddressFields a list of address fields.

See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#type-AddressFields

type AddressUI

type AddressUI struct {
	AddressFields []*AddressFields `json:"addressFields"` // A two dimension array containing the representation of values from an address profile.
}

AddressUI 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.

See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#type-AddressUI

type CreditCard

type CreditCard struct {
	Number      string `json:"number"`      // 16-digit credit card number.
	Name        string `json:"name"`        // Name of the credit card owner.
	ExpiryMonth string `json:"expiryMonth"` // 2-digit expiry month.
	ExpiryYear  string `json:"expiryYear"`  // 4-digit expiry year.
	Cvc         string `json:"cvc"`         // 3-digit card verification code.
}

CreditCard [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#type-CreditCard

type DisableParams

type DisableParams struct{}

DisableParams disables autofill domain notifications.

func Disable

func Disable() *DisableParams

Disable disables autofill domain notifications.

See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#method-disable

func (*DisableParams) Do

func (p *DisableParams) Do(ctx context.Context) (err error)

Do executes Autofill.disable against the provided context.

type EnableParams

type EnableParams struct{}

EnableParams enables autofill domain notifications.

func Enable

func Enable() *EnableParams

Enable enables autofill domain notifications.

See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#method-enable

func (*EnableParams) Do

func (p *EnableParams) Do(ctx context.Context) (err error)

Do executes Autofill.enable against the provided context.

type EventAddressFormFilled

type EventAddressFormFilled struct {
	FilledFields []*FilledField `json:"filledFields"` // Information about the fields that were filled
	AddressUI    *AddressUI     `json:"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.
}

EventAddressFormFilled emitted when an address form is filled.

See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#event-addressFormFilled

type FilledField

type FilledField struct {
	HTMLType        string            `json:"htmlType"`        // The type of the field, e.g text, password etc.
	ID              string            `json:"id"`              // the html id
	Name            string            `json:"name"`            // the html name
	Value           string            `json:"value"`           // the field value
	AutofillType    string            `json:"autofillType"`    // The actual field type, e.g FAMILY_NAME
	FillingStrategy FillingStrategy   `json:"fillingStrategy"` // The filling strategy
	FrameID         cdp.FrameID       `json:"frameId"`         // The frame the field belongs to
	FieldID         cdp.BackendNodeID `json:"fieldId"`         // The form field's DOM node
}

FilledField [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#type-FilledField

type FillingStrategy

type FillingStrategy string

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

See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#type-FillingStrategy

const (
	FillingStrategyAutocompleteAttribute FillingStrategy = "autocompleteAttribute"
	FillingStrategyAutofillInferred      FillingStrategy = "autofillInferred"
)

FillingStrategy values.

func (FillingStrategy) String

func (t FillingStrategy) String() string

String returns the FillingStrategy as string value.

type SetAddressesParams

type SetAddressesParams struct {
	Addresses []*Address `json:"addresses"`
}

SetAddressesParams set addresses so that developers can verify their forms implementation.

func SetAddresses

func SetAddresses(addresses []*Address) *SetAddressesParams

SetAddresses set addresses so that developers can verify their forms implementation.

See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#method-setAddresses

parameters:

addresses

func (*SetAddressesParams) Do

func (p *SetAddressesParams) Do(ctx context.Context) (err error)

Do executes Autofill.setAddresses against the provided context.

type TriggerParams

type TriggerParams struct {
	FieldID cdp.BackendNodeID `json:"fieldId"`                    // Identifies a field that serves as an anchor for autofill.
	FrameID cdp.FrameID       `json:"frameId,omitempty,omitzero"` // Identifies the frame that field belongs to.
	Card    *CreditCard       `json:"card,omitempty,omitzero"`    // Credit card information to fill out the form. Credit card data is not saved.  Mutually exclusive with address.
	Address *Address          `json:"address,omitempty,omitzero"` // Address to fill out the form. Address data is not saved. Mutually exclusive with card.
}

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

func Trigger

func Trigger(fieldID cdp.BackendNodeID) *TriggerParams

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

See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#method-trigger

parameters:

fieldID - Identifies a field that serves as an anchor for autofill.

func (*TriggerParams) Do

func (p *TriggerParams) Do(ctx context.Context) (err error)

Do executes Autofill.trigger against the provided context.

func (TriggerParams) WithAddress

func (p TriggerParams) WithAddress(address *Address) *TriggerParams

WithAddress address to fill out the form. Address data is not saved. Mutually exclusive with card.

func (TriggerParams) WithCard

func (p TriggerParams) WithCard(card *CreditCard) *TriggerParams

WithCard credit card information to fill out the form. Credit card data is not saved. Mutually exclusive with address.

func (TriggerParams) WithFrameID

func (p TriggerParams) WithFrameID(frameID cdp.FrameID) *TriggerParams

WithFrameID identifies the frame that field belongs to.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL