Documentation
¶
Overview ¶
Package autofill implements the Autofill domain. Defines commands and events for Autofill.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Address ¶
type Address struct {
Fields []AddressField `json:"fields"` // fields and values defining an address.
}
Address
type AddressField ¶
type AddressField struct {
Name string `json:"name"` // address field name, for example GIVEN_NAME.
Value string `json:"value"` // address field value, for example Jon Doe.
}
AddressField
type AddressFields ¶
type AddressFields struct {
Fields []AddressField `json:"fields"` // No description.
}
AddressFields A list of address fields.
type AddressFormFilledClient ¶
type AddressFormFilledClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*AddressFormFilledReply, error)
rpcc.Stream
}
AddressFormFilledClient is a client for AddressFormFilled events. Emitted when an address form is filled.
type AddressFormFilledReply ¶
type AddressFormFilledReply 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.
}
AddressFormFilledReply is the reply for AddressFormFilled events.
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
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
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 page.FrameID `json:"frameId"` // The frame the field belongs to
FieldID dom.BackendNodeID `json:"fieldId"` // The form field's DOM node
}
FilledField
type FillingStrategy ¶
type FillingStrategy string
FillingStrategy Specified whether a filled field was done so by using the html autocomplete attribute or autofill heuristics.
const ( FillingStrategyNotSet FillingStrategy = "" FillingStrategyAutocompleteAttribute FillingStrategy = "autocompleteAttribute" FillingStrategyAutofillInferred FillingStrategy = "autofillInferred" )
FillingStrategy as enums.
func (FillingStrategy) String ¶
func (e FillingStrategy) String() string
func (FillingStrategy) Valid ¶
func (e FillingStrategy) Valid() bool
type SetAddressesArgs ¶
type SetAddressesArgs struct {
Addresses []Address `json:"addresses"` // No description.
}
SetAddressesArgs represents the arguments for SetAddresses in the Autofill domain.
func NewSetAddressesArgs ¶
func NewSetAddressesArgs(addresses []Address) *SetAddressesArgs
NewSetAddressesArgs initializes SetAddressesArgs with the required arguments.
type TriggerArgs ¶
type TriggerArgs struct {
FieldID dom.BackendNodeID `json:"fieldId"` // Identifies a field that serves as an anchor for autofill.
FrameID *page.FrameID `json:"frameId,omitempty"` // Identifies the frame that field belongs to.
Card CreditCard `json:"card"` // Credit card information to fill out the form. Credit card data is not saved.
}
TriggerArgs represents the arguments for Trigger in the Autofill domain.
func NewTriggerArgs ¶
func NewTriggerArgs(fieldID dom.BackendNodeID, card CreditCard) *TriggerArgs
NewTriggerArgs initializes TriggerArgs with the required arguments.
func (*TriggerArgs) SetFrameID ¶
func (a *TriggerArgs) SetFrameID(frameID page.FrameID) *TriggerArgs
SetFrameID sets the FrameID optional argument. Identifies the frame that field belongs to.