Documentation ¶
Index ¶
- Constants
- type CompiledFunction
- type Function
- func (fn *Function) AsAnonymous() *Function
- func (fn *Function) AsAsync() *Function
- func (fn *Function) AsNamed(name string) *Function
- func (fn *Function) AsSync() *Function
- func (fn *Function) CallOn(id runtime.RemoteObjectID) *Function
- func (fn *Function) Length() int
- func (fn *Function) String() string
- func (fn *Function) WithArg(value interface{}) *Function
- func (fn *Function) WithArgRef(id runtime.RemoteObjectID) *Function
- func (fn *Function) WithArgRemoteValue(value RemoteValue) *Function
- func (fn *Function) WithArgSelector(selector drivers.QuerySelector) *Function
- func (fn *Function) WithArgValue(value core.Value) *Function
- type FunctionArguments
- type RemoteClassName
- type RemoteObjectType
- type RemoteType
- type RemoteValue
- type Resolver
- func (r *Resolver) SetLoader(loader ValueLoader) *Resolver
- func (r *Resolver) ToElement(ctx context.Context, ref runtime.RemoteObject) (drivers.HTMLElement, error)
- func (r *Resolver) ToProperties(ctx context.Context, id runtime.RemoteObjectID) (*values.Array, error)
- func (r *Resolver) ToProperty(ctx context.Context, id runtime.RemoteObjectID, propName string) (core.Value, error)
- func (r *Resolver) ToValue(ctx context.Context, ref runtime.RemoteObject) (core.Value, error)
- type ReturnType
- type Runtime
- func (rt *Runtime) Call(ctx context.Context, fn *CompiledFunction) error
- func (rt *Runtime) CallElement(ctx context.Context, fn *CompiledFunction) (drivers.HTMLElement, error)
- func (rt *Runtime) CallElements(ctx context.Context, fn *CompiledFunction) (*values.Array, error)
- func (rt *Runtime) CallRef(ctx context.Context, fn *CompiledFunction) (runtime.RemoteObject, error)
- func (rt *Runtime) CallValue(ctx context.Context, fn *CompiledFunction) (core.Value, error)
- func (rt *Runtime) Compile(ctx context.Context, fn *Function) (*CompiledFunction, error)
- func (rt *Runtime) ContextID() runtime.ExecutionContextID
- func (rt *Runtime) Eval(ctx context.Context, fn *Function) error
- func (rt *Runtime) EvalElement(ctx context.Context, fn *Function) (core.Value, error)
- func (rt *Runtime) EvalElements(ctx context.Context, fn *Function) (*values.Array, error)
- func (rt *Runtime) EvalRef(ctx context.Context, fn *Function) (runtime.RemoteObject, error)
- func (rt *Runtime) EvalValue(ctx context.Context, fn *Function) (core.Value, error)
- func (rt *Runtime) SetLoader(loader ValueLoader) *Runtime
- type ValueLoader
- type ValueLoaderFn
Constants ¶
View Source
const ( EmptyExecutionContextID = runtime.ExecutionContextID(-1) EmptyObjectID = runtime.RemoteObjectID("") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompiledFunction ¶ added in v0.16.0
type CompiledFunction struct {
// contains filtered or unexported fields
}
type Function ¶ added in v0.16.0
type Function struct {
// contains filtered or unexported fields
}
func (*Function) AsAnonymous ¶ added in v0.16.0
func (*Function) CallOn ¶ added in v0.16.0
func (fn *Function) CallOn(id runtime.RemoteObjectID) *Function
func (*Function) WithArgRef ¶ added in v0.16.0
func (fn *Function) WithArgRef(id runtime.RemoteObjectID) *Function
func (*Function) WithArgRemoteValue ¶ added in v0.16.0
func (fn *Function) WithArgRemoteValue(value RemoteValue) *Function
func (*Function) WithArgSelector ¶ added in v0.16.0
func (fn *Function) WithArgSelector(selector drivers.QuerySelector) *Function
type FunctionArguments ¶ added in v0.16.0
type FunctionArguments []runtime.CallArgument
func (FunctionArguments) MarshalZerologArray ¶ added in v0.16.0
func (args FunctionArguments) MarshalZerologArray(a *zerolog.Array)
type RemoteClassName ¶ added in v0.16.0
type RemoteClassName string
const ( UnknownClassName RemoteClassName = "" DocumentClassName RemoteClassName = "HTMLDocument" )
List of supported remote classses
func ToRemoteClassName ¶ added in v0.16.0
func ToRemoteClassName(ref runtime.RemoteObject) RemoteClassName
type RemoteObjectType ¶ added in v0.16.0
type RemoteObjectType string
const ( UnknownObjectType RemoteObjectType = "" NullObjectType RemoteObjectType = "null" UndefinedObjectType RemoteObjectType = "undefined" ArrayObjectType RemoteObjectType = "array" NodeObjectType RemoteObjectType = "node" RegexpObjectType RemoteObjectType = "regexp" DateObjectType RemoteObjectType = "date" MapObjectType RemoteObjectType = "map" SetObjectType RemoteObjectType = "set" WeakMapObjectType RemoteObjectType = "weakmap" WeakSetObjectType RemoteObjectType = "weakset" IteratorObjectType RemoteObjectType = "iterator" GeneratorObjectType RemoteObjectType = "generator" ErrorObjectType RemoteObjectType = "error" ProxyObjectType RemoteObjectType = "proxy" PromiseObjectType RemoteObjectType = "promise" TypedArrayObjectType RemoteObjectType = "typedarray" ArrayBufferObjectType RemoteObjectType = "arraybuffer" DataViewObjectType RemoteObjectType = "dataview" )
List of possible remote object types
func ToRemoteObjectType ¶ added in v0.16.0
func ToRemoteObjectType(ref runtime.RemoteObject) RemoteObjectType
type RemoteType ¶ added in v0.16.0
type RemoteType string
const ( UnknownType RemoteType = "" UndefinedType RemoteType = "undefined" StringType RemoteType = "string" NumberType RemoteType = "number" BooleanType RemoteType = "boolean" SymbolType RemoteType = "symbol" BigintType RemoteType = "bigint" ObjectType RemoteType = "object" )
List of possible remote types "object", "function", "undefined", "string", "number", "boolean", "symbol", "bigint"
func ToRemoteType ¶ added in v0.16.0
func ToRemoteType(ref runtime.RemoteObject) RemoteType
type RemoteValue ¶ added in v0.16.0
type RemoteValue interface {
RemoteID() runtime.RemoteObjectID
}
type Resolver ¶ added in v0.16.0
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶ added in v0.16.0
func (*Resolver) SetLoader ¶ added in v0.16.0
func (r *Resolver) SetLoader(loader ValueLoader) *Resolver
func (*Resolver) ToElement ¶ added in v0.16.0
func (r *Resolver) ToElement(ctx context.Context, ref runtime.RemoteObject) (drivers.HTMLElement, error)
func (*Resolver) ToProperties ¶ added in v0.16.0
func (*Resolver) ToProperty ¶ added in v0.16.0
type ReturnType ¶ added in v0.16.0
type ReturnType int
const ( ReturnNothing ReturnType = iota ReturnValue ReturnRef )
func (ReturnType) String ¶ added in v0.16.0
func (rt ReturnType) String() string
type Runtime ¶ added in v0.16.0
type Runtime struct {
// contains filtered or unexported fields
}
func (*Runtime) Call ¶ added in v0.16.0
func (rt *Runtime) Call(ctx context.Context, fn *CompiledFunction) error
func (*Runtime) CallElement ¶ added in v0.16.0
func (rt *Runtime) CallElement(ctx context.Context, fn *CompiledFunction) (drivers.HTMLElement, error)
func (*Runtime) CallElements ¶ added in v0.16.0
func (*Runtime) CallRef ¶ added in v0.16.0
func (rt *Runtime) CallRef(ctx context.Context, fn *CompiledFunction) (runtime.RemoteObject, error)
func (*Runtime) ContextID ¶ added in v0.16.0
func (rt *Runtime) ContextID() runtime.ExecutionContextID
func (*Runtime) EvalElement ¶ added in v0.16.0
func (*Runtime) EvalElements ¶ added in v0.16.0
func (*Runtime) SetLoader ¶ added in v0.16.0
func (rt *Runtime) SetLoader(loader ValueLoader) *Runtime
type ValueLoader ¶ added in v0.16.0
type ValueLoader interface { Load( ctx context.Context, frameID page.FrameID, remoteType RemoteObjectType, remoteClass RemoteClassName, id runtime.RemoteObjectID, ) (core.Value, error) }
type ValueLoaderFn ¶ added in v0.16.0
type ValueLoaderFn func( ctx context.Context, frameID page.FrameID, remoteType RemoteObjectType, remoteClass RemoteClassName, id runtime.RemoteObjectID, ) (core.Value, error)
func (ValueLoaderFn) Load ¶ added in v0.16.0
func (f ValueLoaderFn) Load( ctx context.Context, frameID page.FrameID, remoteType RemoteObjectType, remoteClass RemoteClassName, id runtime.RemoteObjectID, ) (core.Value, error)
Click to show internal directories.
Click to hide internal directories.