Documentation ¶
Overview ¶
Package nodewith is used to generate queries to find chrome.automation nodes.
Index ¶
- Constants
- type Finder
- func Ancestor(a *Finder) *Finder
- func Attribute(k string, v interface{}) *Finder
- func AutofillAvailable() *Finder
- func ClassName(n string) *Finder
- func Collapsed() *Finder
- func Default() *Finder
- func Editable() *Finder
- func Expanded() *Finder
- func First() *Finder
- func Focusable() *Finder
- func Focused() *Finder
- func HasClass(c string) *Finder
- func Horizontal() *Finder
- func Hovered() *Finder
- func Ignored() *Finder
- func Invisible() *Finder
- func Linked() *Finder
- func Multiline() *Finder
- func MultilingualName(english string, other map[string]string) *Finder
- func MultilingualNameContaining(english string, other map[string]string) *Finder
- func MultilingualNameRegex(english *regexp.Regexp, other map[string]regexp.Regexp) *Finder
- func MultilingualNameStartingWith(english string, other map[string]string) *Finder
- func Multiselectable() *Finder
- func Name(n string) *Finder
- func NameContaining(n string) *Finder
- func NameRegex(r *regexp.Regexp) *Finder
- func NameStartingWith(n string) *Finder
- func Nth(n int) *Finder
- func Offscreen() *Finder
- func Onscreen() *Finder
- func Protected() *Finder
- func Required() *Finder
- func RichlyEditable() *Finder
- func Role(r role.Role) *Finder
- func Root() *Finder
- func State(k state.State, v bool) *Finder
- func Vertical() *Finder
- func Visible() *Finder
- func Visited() *Finder
- func (f *Finder) Ancestor(a *Finder) *Finder
- func (f *Finder) Attribute(k string, v interface{}) *Finder
- func (f *Finder) AutofillAvailable() *Finder
- func (f *Finder) ClassName(n string) *Finder
- func (f *Finder) Collapsed() *Finder
- func (f *Finder) Default() *Finder
- func (f *Finder) Editable() *Finder
- func (f *Finder) Expanded() *Finder
- func (f *Finder) FinalAncestor(a *Finder) *Finder
- func (f *Finder) First() *Finder
- func (f *Finder) Focusable() *Finder
- func (f *Finder) Focused() *Finder
- func (f *Finder) GenerateQuery() (string, error)
- func (f *Finder) GenerateQueryForMultipleNodes() (string, error)
- func (f *Finder) HasClass(c string) *Finder
- func (f *Finder) Horizontal() *Finder
- func (f *Finder) Hovered() *Finder
- func (f *Finder) Ignored() *Finder
- func (f *Finder) Invisible() *Finder
- func (f *Finder) Linked() *Finder
- func (f *Finder) Multiline() *Finder
- func (f *Finder) MultilingualName(english string, other map[string]string) *Finder
- func (f *Finder) MultilingualNameContaining(english string, other map[string]string) *Finder
- func (f *Finder) MultilingualNameRegex(english *regexp.Regexp, other map[string]regexp.Regexp) *Finder
- func (f *Finder) MultilingualNameStartingWith(english string, other map[string]string) *Finder
- func (f *Finder) Multiselectable() *Finder
- func (f *Finder) Name(n string) *Finder
- func (f *Finder) NameContaining(n string) *Finder
- func (f *Finder) NameRegex(r *regexp.Regexp) *Finder
- func (f *Finder) NameStartingWith(n string) *Finder
- func (f *Finder) Nth(n int) *Finder
- func (f *Finder) Offscreen() *Finder
- func (f *Finder) Onscreen() *Finder
- func (f *Finder) Pretty() string
- func (f *Finder) Protected() *Finder
- func (f *Finder) Required() *Finder
- func (f *Finder) RichlyEditable() *Finder
- func (f *Finder) Role(r role.Role) *Finder
- func (f *Finder) State(k state.State, v bool) *Finder
- func (f *Finder) Vertical() *Finder
- func (f *Finder) Visible() *Finder
- func (f *Finder) Visited() *Finder
Constants ¶
const ( ErrNotFound = "failed to find node with properties" ErrTooGeneric = "multiple nodes matched, if you expect this and only want the first use First()" )
These are possible errors return by query for a node in JS. They are strings because JS does not return nice Go errors. Instead, it is simplest to just use strings.Contains with these errors.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Finder ¶
type Finder struct {
// contains filtered or unexported fields
}
Finder is a mapping of chrome.automation.FindParams to Golang with a nicer API. As defined in chromium/src/extensions/common/api/automation.idl
func AutofillAvailable ¶
func AutofillAvailable() *Finder
AutofillAvailable creates a Finder with AutofillAvailable set to true.
func ClassName ¶
ClassName creates a Finder with the specified class name. Deprecated: Use HasClass.
func First ¶
func First() *Finder
First creates a Finder that will find the first node instead of requiring uniqueness.
func Horizontal ¶
func Horizontal() *Finder
Horizontal creates a Finder with Horizontal set to true.
func MultilingualName ¶
MultilingualName creates a Finder with the specified names.
func MultilingualNameContaining ¶
MultilingualNameContaining creates a Finder with a name containing the specified strings.
func MultilingualNameRegex ¶
MultilingualNameRegex creates a Finder with a name containing the specified regexp.
func MultilingualNameStartingWith ¶
MultilingualNameStartingWith creates a Finder with a name starting with the specified strings.
func Multiselectable ¶
func Multiselectable() *Finder
Multiselectable creates a Finder with Multiselectable set to true.
func NameContaining ¶
NameContaining creates a Finder with a name containing the specified string.
func NameStartingWith ¶
NameStartingWith creates a Finder with a name starting with the specified string.
func Nth ¶
Nth creates a Finder that will find the n-th node in the matched nodes of the Finder, instead of requiring uniqueness.
func RichlyEditable ¶
func RichlyEditable() *Finder
RichlyEditable creates a Finder with RichlyEditable set to true.
func (*Finder) Attribute ¶
Attribute creates a copy of the input Finder with the specified attribute.
func (*Finder) AutofillAvailable ¶
AutofillAvailable creates a copy of the input Finder with AutofillAvailable set to true.
func (*Finder) ClassName ¶
ClassName creates a copy of the input Finder with the specified class name. Deprecated: Use HasClass.
func (*Finder) FinalAncestor ¶
FinalAncestor creates a copy of the chain of Finders such that the final ancestor is set to a. This can be used to scope an entire query to be a subset of different query.
func (*Finder) First ¶
First creates a copy of the input Finder that will find the first node instead of requiring uniqueness.
func (*Finder) GenerateQuery ¶
GenerateQuery generates the JS query to find this node. It must be called in an async function because it starts by awaiting the chrome.automation Desktop node. The final node will be in the variable node.
func (*Finder) GenerateQueryForMultipleNodes ¶
GenerateQueryForMultipleNodes generates the JS query to find one or more nodes. It must be called in an async function because it starts by awaiting the chrome.automation Desktop node.
func (*Finder) HasClass ¶
HasClass creates a copy of the input Finder with a class name containing the specified class name.
func (*Finder) Horizontal ¶
Horizontal creates a copy of the input Finder with Horizontal set to true.
func (*Finder) MultilingualName ¶
MultilingualName creates a copy of the input Finder with the specified names.
func (*Finder) MultilingualNameContaining ¶
MultilingualNameContaining creates a copy of the input Finder with a name containing the specified strings.
func (*Finder) MultilingualNameRegex ¶
func (f *Finder) MultilingualNameRegex(english *regexp.Regexp, other map[string]regexp.Regexp) *Finder
MultilingualNameRegex creates a copy of the input Finder with a name containing the specified regexp.
func (*Finder) MultilingualNameStartingWith ¶
MultilingualNameStartingWith creates a copy of the input Finder with a name starting with the specified strings.
func (*Finder) Multiselectable ¶
Multiselectable creates a copy of the input Finder with Multiselectable set to true.
func (*Finder) NameContaining ¶
NameContaining creates a copy of the input Finder with a name containing the specified string.
func (*Finder) NameRegex ¶
NameRegex creates a copy of the input Finder with a name containing the specified regexp.
func (*Finder) NameStartingWith ¶
NameStartingWith creates a copy of the input Finder with a name starting with the specified string.
func (*Finder) Nth ¶
Nth creates a copy of the input Finder that will find the n-th node in the matched nodes of the Finder, instead of requiring uniqueness.
func (*Finder) Pretty ¶
Pretty returns a nice-looking human-readable version of the finder. For example, Pretty(Name("hello").ClassName("cls").Ancestor(Role(role.Button))) will return `{name: /^hello$/, className: "cls", ancestor: {role: button}}`.
func (*Finder) RichlyEditable ¶
RichlyEditable creates a copy of the input Finder with RichlyEditable set to true.