Documentation ¶
Overview ¶
Package runtime implements the Runtime domain. Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose object type, string representation and unique identifier that can be used for further object reference. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.
Index ¶
- func NewClient(conn *rpcc.Conn) *domainClient
- type AwaitPromiseArgs
- type AwaitPromiseReply
- type CallArgument
- type CallFrame
- type CallFunctionOnArgs
- func (a *CallFunctionOnArgs) SetArguments(arguments []CallArgument) *CallFunctionOnArgs
- func (a *CallFunctionOnArgs) SetAwaitPromise(awaitPromise bool) *CallFunctionOnArgs
- func (a *CallFunctionOnArgs) SetGeneratePreview(generatePreview bool) *CallFunctionOnArgs
- func (a *CallFunctionOnArgs) SetReturnByValue(returnByValue bool) *CallFunctionOnArgs
- func (a *CallFunctionOnArgs) SetSilent(silent bool) *CallFunctionOnArgs
- func (a *CallFunctionOnArgs) SetUserGesture(userGesture bool) *CallFunctionOnArgs
- type CallFunctionOnReply
- type CompileScriptArgs
- type CompileScriptReply
- type ConsoleAPICalledClient
- type ConsoleAPICalledReply
- type CustomPreview
- type EntryPreview
- type EvaluateArgs
- func (a *EvaluateArgs) SetAwaitPromise(awaitPromise bool) *EvaluateArgs
- func (a *EvaluateArgs) SetContextID(contextID ExecutionContextID) *EvaluateArgs
- func (a *EvaluateArgs) SetGeneratePreview(generatePreview bool) *EvaluateArgs
- func (a *EvaluateArgs) SetIncludeCommandLineAPI(includeCommandLineAPI bool) *EvaluateArgs
- func (a *EvaluateArgs) SetObjectGroup(objectGroup string) *EvaluateArgs
- func (a *EvaluateArgs) SetReturnByValue(returnByValue bool) *EvaluateArgs
- func (a *EvaluateArgs) SetSilent(silent bool) *EvaluateArgs
- func (a *EvaluateArgs) SetUserGesture(userGesture bool) *EvaluateArgs
- type EvaluateReply
- type ExceptionDetails
- type ExceptionRevokedClient
- type ExceptionRevokedReply
- type ExceptionThrownClient
- type ExceptionThrownReply
- type ExecutionContextCreatedClient
- type ExecutionContextCreatedReply
- type ExecutionContextDescription
- type ExecutionContextDestroyedClient
- type ExecutionContextDestroyedReply
- type ExecutionContextID
- type ExecutionContextsClearedClient
- type ExecutionContextsClearedReply
- type GetPropertiesArgs
- type GetPropertiesReply
- type InspectRequestedClient
- type InspectRequestedReply
- type InternalPropertyDescriptor
- type ObjectPreview
- type PropertyDescriptor
- type PropertyPreview
- type ReleaseObjectArgs
- type ReleaseObjectGroupArgs
- type RemoteObject
- type RemoteObjectID
- type RunScriptArgs
- func (a *RunScriptArgs) SetAwaitPromise(awaitPromise bool) *RunScriptArgs
- func (a *RunScriptArgs) SetExecutionContextID(executionContextID ExecutionContextID) *RunScriptArgs
- func (a *RunScriptArgs) SetGeneratePreview(generatePreview bool) *RunScriptArgs
- func (a *RunScriptArgs) SetIncludeCommandLineAPI(includeCommandLineAPI bool) *RunScriptArgs
- func (a *RunScriptArgs) SetObjectGroup(objectGroup string) *RunScriptArgs
- func (a *RunScriptArgs) SetReturnByValue(returnByValue bool) *RunScriptArgs
- func (a *RunScriptArgs) SetSilent(silent bool) *RunScriptArgs
- type RunScriptReply
- type ScriptID
- type SetCustomObjectFormatterEnabledArgs
- type StackTrace
- type Timestamp
- type UnserializableValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AwaitPromiseArgs ¶
type AwaitPromiseArgs struct { PromiseObjectID RemoteObjectID `json:"promiseObjectId"` // Identifier of the promise. ReturnByValue *bool `json:"returnByValue,omitempty"` // Whether the result is expected to be a JSON object that should be sent by value. GeneratePreview *bool `json:"generatePreview,omitempty"` // Whether preview should be generated for the result. }
AwaitPromiseArgs represents the arguments for AwaitPromise in the Runtime domain.
func NewAwaitPromiseArgs ¶
func NewAwaitPromiseArgs(promiseObjectID RemoteObjectID) *AwaitPromiseArgs
NewAwaitPromiseArgs initializes AwaitPromiseArgs with the required arguments.
func (*AwaitPromiseArgs) SetGeneratePreview ¶
func (a *AwaitPromiseArgs) SetGeneratePreview(generatePreview bool) *AwaitPromiseArgs
SetGeneratePreview sets the GeneratePreview optional argument. Whether preview should be generated for the result.
func (*AwaitPromiseArgs) SetReturnByValue ¶
func (a *AwaitPromiseArgs) SetReturnByValue(returnByValue bool) *AwaitPromiseArgs
SetReturnByValue sets the ReturnByValue optional argument. Whether the result is expected to be a JSON object that should be sent by value.
type AwaitPromiseReply ¶
type AwaitPromiseReply struct { Result RemoteObject `json:"result"` // Promise result. Will contain rejected value if promise was rejected. ExceptionDetails *ExceptionDetails `json:"exceptionDetails,omitempty"` // Exception details if stack strace is available. }
AwaitPromiseReply represents the return values for AwaitPromise in the Runtime domain.
type CallArgument ¶
type CallArgument struct { Value json.RawMessage `json:"value,omitempty"` // Primitive value. UnserializableValue UnserializableValue `json:"unserializableValue,omitempty"` // Primitive value which can not be JSON-stringified. ObjectID *RemoteObjectID `json:"objectId,omitempty"` // Remote object handle. }
CallArgument Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified.
type CallFrame ¶
type CallFrame struct { FunctionName string `json:"functionName"` // JavaScript function name. ScriptID ScriptID `json:"scriptId"` // JavaScript script id. URL string `json:"url"` // JavaScript script name or url. LineNumber int `json:"lineNumber"` // JavaScript script line number (0-based). ColumnNumber int `json:"columnNumber"` // JavaScript script column number (0-based). }
CallFrame Stack entry for runtime errors and assertions.
type CallFunctionOnArgs ¶
type CallFunctionOnArgs struct { ObjectID RemoteObjectID `json:"objectId"` // Identifier of the object to call function on. FunctionDeclaration string `json:"functionDeclaration"` // Declaration of the function to call. Arguments []CallArgument `json:"arguments,omitempty"` // Call arguments. All call arguments must belong to the same JavaScript world as the target object. Silent *bool `json:"silent,omitempty"` // In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. ReturnByValue *bool `json:"returnByValue,omitempty"` // Whether the result is expected to be a JSON object which should be sent by value. GeneratePreview *bool `json:"generatePreview,omitempty"` // Whether preview should be generated for the result. UserGesture *bool `json:"userGesture,omitempty"` // Whether execution should be treated as initiated by user in the UI. AwaitPromise *bool `json:"awaitPromise,omitempty"` // Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. }
CallFunctionOnArgs represents the arguments for CallFunctionOn in the Runtime domain.
func NewCallFunctionOnArgs ¶
func NewCallFunctionOnArgs(objectID RemoteObjectID, functionDeclaration string) *CallFunctionOnArgs
NewCallFunctionOnArgs initializes CallFunctionOnArgs with the required arguments.
func (*CallFunctionOnArgs) SetArguments ¶
func (a *CallFunctionOnArgs) SetArguments(arguments []CallArgument) *CallFunctionOnArgs
SetArguments sets the Arguments optional argument. Call arguments. All call arguments must belong to the same JavaScript world as the target object.
func (*CallFunctionOnArgs) SetAwaitPromise ¶
func (a *CallFunctionOnArgs) SetAwaitPromise(awaitPromise bool) *CallFunctionOnArgs
SetAwaitPromise sets the AwaitPromise optional argument. Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error.
func (*CallFunctionOnArgs) SetGeneratePreview ¶
func (a *CallFunctionOnArgs) SetGeneratePreview(generatePreview bool) *CallFunctionOnArgs
SetGeneratePreview sets the GeneratePreview optional argument. Whether preview should be generated for the result.
func (*CallFunctionOnArgs) SetReturnByValue ¶
func (a *CallFunctionOnArgs) SetReturnByValue(returnByValue bool) *CallFunctionOnArgs
SetReturnByValue sets the ReturnByValue optional argument. Whether the result is expected to be a JSON object which should be sent by value.
func (*CallFunctionOnArgs) SetSilent ¶
func (a *CallFunctionOnArgs) SetSilent(silent bool) *CallFunctionOnArgs
SetSilent sets the Silent optional argument. In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.
func (*CallFunctionOnArgs) SetUserGesture ¶
func (a *CallFunctionOnArgs) SetUserGesture(userGesture bool) *CallFunctionOnArgs
SetUserGesture sets the UserGesture optional argument. Whether execution should be treated as initiated by user in the UI.
type CallFunctionOnReply ¶
type CallFunctionOnReply struct { Result RemoteObject `json:"result"` // Call result. ExceptionDetails *ExceptionDetails `json:"exceptionDetails,omitempty"` // Exception details. }
CallFunctionOnReply represents the return values for CallFunctionOn in the Runtime domain.
type CompileScriptArgs ¶
type CompileScriptArgs struct { Expression string `json:"expression"` // Expression to compile. SourceURL string `json:"sourceURL"` // Source url to be set for the script. PersistScript bool `json:"persistScript"` // Specifies whether the compiled script should be persisted. ExecutionContextID *ExecutionContextID `json:"executionContextId,omitempty"` // Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. }
CompileScriptArgs represents the arguments for CompileScript in the Runtime domain.
func NewCompileScriptArgs ¶
func NewCompileScriptArgs(expression string, sourceURL string, persistScript bool) *CompileScriptArgs
NewCompileScriptArgs initializes CompileScriptArgs with the required arguments.
func (*CompileScriptArgs) SetExecutionContextID ¶
func (a *CompileScriptArgs) SetExecutionContextID(executionContextID ExecutionContextID) *CompileScriptArgs
SetExecutionContextID sets the ExecutionContextID optional argument. Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
type CompileScriptReply ¶
type CompileScriptReply struct { ScriptID *ScriptID `json:"scriptId,omitempty"` // Id of the script. ExceptionDetails *ExceptionDetails `json:"exceptionDetails,omitempty"` // Exception details. }
CompileScriptReply represents the return values for CompileScript in the Runtime domain.
type ConsoleAPICalledClient ¶
type ConsoleAPICalledClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*ConsoleAPICalledReply, error) rpcc.Stream }
ConsoleAPICalledClient is a client for ConsoleAPICalled events. Issued when console API was called.
type ConsoleAPICalledReply ¶
type ConsoleAPICalledReply struct { Type string `json:"type"` // Type of the call. Args []RemoteObject `json:"args"` // Call arguments. ExecutionContextID ExecutionContextID `json:"executionContextId"` // Identifier of the context where the call was made. Timestamp Timestamp `json:"timestamp"` // Call timestamp. StackTrace *StackTrace `json:"stackTrace,omitempty"` // Stack trace captured when the call was made. Context *string `json:"context,omitempty"` // Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. }
ConsoleAPICalledReply is the reply for ConsoleAPICalled events.
type CustomPreview ¶
type CustomPreview struct { Header string `json:"header"` // HasBody bool `json:"hasBody"` // FormatterObjectID RemoteObjectID `json:"formatterObjectId"` // BindRemoteObjectFunctionID RemoteObjectID `json:"bindRemoteObjectFunctionId"` // ConfigObjectID *RemoteObjectID `json:"configObjectId,omitempty"` // }
CustomPreview
type EntryPreview ¶
type EntryPreview struct { Key *ObjectPreview `json:"key,omitempty"` // Preview of the key. Specified for map-like collection entries. Value ObjectPreview `json:"value"` // Preview of the value. }
EntryPreview
func (EntryPreview) String ¶
func (r EntryPreview) String() string
String returns a human readable string of the entry preview.
type EvaluateArgs ¶
type EvaluateArgs struct { Expression string `json:"expression"` // Expression to evaluate. ObjectGroup *string `json:"objectGroup,omitempty"` // Symbolic group name that can be used to release multiple objects. IncludeCommandLineAPI *bool `json:"includeCommandLineAPI,omitempty"` // Determines whether Command Line API should be available during the evaluation. Silent *bool `json:"silent,omitempty"` // In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. ContextID *ExecutionContextID `json:"contextId,omitempty"` // Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. ReturnByValue *bool `json:"returnByValue,omitempty"` // Whether the result is expected to be a JSON object that should be sent by value. GeneratePreview *bool `json:"generatePreview,omitempty"` // Whether preview should be generated for the result. UserGesture *bool `json:"userGesture,omitempty"` // Whether execution should be treated as initiated by user in the UI. AwaitPromise *bool `json:"awaitPromise,omitempty"` // Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. }
EvaluateArgs represents the arguments for Evaluate in the Runtime domain.
func NewEvaluateArgs ¶
func NewEvaluateArgs(expression string) *EvaluateArgs
NewEvaluateArgs initializes EvaluateArgs with the required arguments.
func (*EvaluateArgs) SetAwaitPromise ¶
func (a *EvaluateArgs) SetAwaitPromise(awaitPromise bool) *EvaluateArgs
SetAwaitPromise sets the AwaitPromise optional argument. Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error.
func (*EvaluateArgs) SetContextID ¶
func (a *EvaluateArgs) SetContextID(contextID ExecutionContextID) *EvaluateArgs
SetContextID sets the ContextID optional argument. Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
func (*EvaluateArgs) SetGeneratePreview ¶
func (a *EvaluateArgs) SetGeneratePreview(generatePreview bool) *EvaluateArgs
SetGeneratePreview sets the GeneratePreview optional argument. Whether preview should be generated for the result.
func (*EvaluateArgs) SetIncludeCommandLineAPI ¶
func (a *EvaluateArgs) SetIncludeCommandLineAPI(includeCommandLineAPI bool) *EvaluateArgs
SetIncludeCommandLineAPI sets the IncludeCommandLineAPI optional argument. Determines whether Command Line API should be available during the evaluation.
func (*EvaluateArgs) SetObjectGroup ¶
func (a *EvaluateArgs) SetObjectGroup(objectGroup string) *EvaluateArgs
SetObjectGroup sets the ObjectGroup optional argument. Symbolic group name that can be used to release multiple objects.
func (*EvaluateArgs) SetReturnByValue ¶
func (a *EvaluateArgs) SetReturnByValue(returnByValue bool) *EvaluateArgs
SetReturnByValue sets the ReturnByValue optional argument. Whether the result is expected to be a JSON object that should be sent by value.
func (*EvaluateArgs) SetSilent ¶
func (a *EvaluateArgs) SetSilent(silent bool) *EvaluateArgs
SetSilent sets the Silent optional argument. In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.
func (*EvaluateArgs) SetUserGesture ¶
func (a *EvaluateArgs) SetUserGesture(userGesture bool) *EvaluateArgs
SetUserGesture sets the UserGesture optional argument. Whether execution should be treated as initiated by user in the UI.
type EvaluateReply ¶
type EvaluateReply struct { Result RemoteObject `json:"result"` // Evaluation result. ExceptionDetails *ExceptionDetails `json:"exceptionDetails,omitempty"` // Exception details. }
EvaluateReply represents the return values for Evaluate in the Runtime domain.
type ExceptionDetails ¶
type ExceptionDetails struct { ExceptionID int `json:"exceptionId"` // Exception id. Text string `json:"text"` // Exception text, which should be used together with exception object when available. LineNumber int `json:"lineNumber"` // Line number of the exception location (0-based). ColumnNumber int `json:"columnNumber"` // Column number of the exception location (0-based). ScriptID *ScriptID `json:"scriptId,omitempty"` // Script ID of the exception location. URL *string `json:"url,omitempty"` // URL of the exception location, to be used when the script was not reported. StackTrace *StackTrace `json:"stackTrace,omitempty"` // JavaScript stack trace if available. Exception *RemoteObject `json:"exception,omitempty"` // Exception object if available. ExecutionContextID *ExecutionContextID `json:"executionContextId,omitempty"` // Identifier of the context where exception happened. }
ExceptionDetails Detailed information about exception (or error) that was thrown during script compilation or execution.
func (ExceptionDetails) Error ¶
func (r ExceptionDetails) Error() string
Error implements error for ExceptionDetails.
type ExceptionRevokedClient ¶
type ExceptionRevokedClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*ExceptionRevokedReply, error) rpcc.Stream }
ExceptionRevokedClient is a client for ExceptionRevoked events. Issued when unhandled exception was revoked.
type ExceptionRevokedReply ¶
type ExceptionRevokedReply struct { Reason string `json:"reason"` // Reason describing why exception was revoked. ExceptionID int `json:"exceptionId"` // The id of revoked exception, as reported in exceptionUnhandled. }
ExceptionRevokedReply is the reply for ExceptionRevoked events.
type ExceptionThrownClient ¶
type ExceptionThrownClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*ExceptionThrownReply, error) rpcc.Stream }
ExceptionThrownClient is a client for ExceptionThrown events. Issued when exception was thrown and unhandled.
type ExceptionThrownReply ¶
type ExceptionThrownReply struct { Timestamp Timestamp `json:"timestamp"` // Timestamp of the exception. ExceptionDetails ExceptionDetails `json:"exceptionDetails"` // }
ExceptionThrownReply is the reply for ExceptionThrown events.
type ExecutionContextCreatedClient ¶
type ExecutionContextCreatedClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*ExecutionContextCreatedReply, error) rpcc.Stream }
ExecutionContextCreatedClient is a client for ExecutionContextCreated events. Issued when new execution context is created.
type ExecutionContextCreatedReply ¶
type ExecutionContextCreatedReply struct {
Context ExecutionContextDescription `json:"context"` // A newly created execution context.
}
ExecutionContextCreatedReply is the reply for ExecutionContextCreated events.
type ExecutionContextDescription ¶
type ExecutionContextDescription struct { ID ExecutionContextID `json:"id"` // Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. Origin string `json:"origin"` // Execution context origin. Name string `json:"name"` // Human readable name describing given context. AuxData json.RawMessage `json:"auxData,omitempty"` // Embedder-specific auxiliary data. }
ExecutionContextDescription Description of an isolated world.
type ExecutionContextDestroyedClient ¶
type ExecutionContextDestroyedClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*ExecutionContextDestroyedReply, error) rpcc.Stream }
ExecutionContextDestroyedClient is a client for ExecutionContextDestroyed events. Issued when execution context is destroyed.
type ExecutionContextDestroyedReply ¶
type ExecutionContextDestroyedReply struct {
ExecutionContextID ExecutionContextID `json:"executionContextId"` // Id of the destroyed context
}
ExecutionContextDestroyedReply is the reply for ExecutionContextDestroyed events.
type ExecutionContextID ¶
type ExecutionContextID int
ExecutionContextID Id of an execution context.
type ExecutionContextsClearedClient ¶
type ExecutionContextsClearedClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*ExecutionContextsClearedReply, error) rpcc.Stream }
ExecutionContextsClearedClient is a client for ExecutionContextsCleared events. Issued when all executionContexts were cleared in browser
type ExecutionContextsClearedReply ¶
type ExecutionContextsClearedReply struct{}
ExecutionContextsClearedReply is the reply for ExecutionContextsCleared events.
type GetPropertiesArgs ¶
type GetPropertiesArgs struct { ObjectID RemoteObjectID `json:"objectId"` // Identifier of the object to return properties for. OwnProperties *bool `json:"ownProperties,omitempty"` // If true, returns properties belonging only to the element itself, not to its prototype chain. AccessorPropertiesOnly *bool `json:"accessorPropertiesOnly,omitempty"` // If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. GeneratePreview *bool `json:"generatePreview,omitempty"` // Whether preview should be generated for the results. }
GetPropertiesArgs represents the arguments for GetProperties in the Runtime domain.
func NewGetPropertiesArgs ¶
func NewGetPropertiesArgs(objectID RemoteObjectID) *GetPropertiesArgs
NewGetPropertiesArgs initializes GetPropertiesArgs with the required arguments.
func (*GetPropertiesArgs) SetAccessorPropertiesOnly ¶
func (a *GetPropertiesArgs) SetAccessorPropertiesOnly(accessorPropertiesOnly bool) *GetPropertiesArgs
SetAccessorPropertiesOnly sets the AccessorPropertiesOnly optional argument. If true, returns accessor properties (with getter/setter) only; internal properties are not returned either.
func (*GetPropertiesArgs) SetGeneratePreview ¶
func (a *GetPropertiesArgs) SetGeneratePreview(generatePreview bool) *GetPropertiesArgs
SetGeneratePreview sets the GeneratePreview optional argument. Whether preview should be generated for the results.
func (*GetPropertiesArgs) SetOwnProperties ¶
func (a *GetPropertiesArgs) SetOwnProperties(ownProperties bool) *GetPropertiesArgs
SetOwnProperties sets the OwnProperties optional argument. If true, returns properties belonging only to the element itself, not to its prototype chain.
type GetPropertiesReply ¶
type GetPropertiesReply struct { Result []PropertyDescriptor `json:"result"` // Object properties. InternalProperties []InternalPropertyDescriptor `json:"internalProperties,omitempty"` // Internal object properties (only of the element itself). ExceptionDetails *ExceptionDetails `json:"exceptionDetails,omitempty"` // Exception details. }
GetPropertiesReply represents the return values for GetProperties in the Runtime domain.
type InspectRequestedClient ¶
type InspectRequestedClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*InspectRequestedReply, error) rpcc.Stream }
InspectRequestedClient is a client for InspectRequested events. Issued when object should be inspected (for example, as a result of inspect() command line API call).
type InspectRequestedReply ¶
type InspectRequestedReply struct { Object RemoteObject `json:"object"` // Hints json.RawMessage `json:"hints"` // }
InspectRequestedReply is the reply for InspectRequested events.
type InternalPropertyDescriptor ¶
type InternalPropertyDescriptor struct { Name string `json:"name"` // Conventional property name. Value *RemoteObject `json:"value,omitempty"` // The value associated with the property. }
InternalPropertyDescriptor Object internal property descriptor. This property isn't normally visible in JavaScript code.
type ObjectPreview ¶
type ObjectPreview struct { Type string `json:"type"` // Object type. Subtype *string `json:"subtype,omitempty"` // Object subtype hint. Specified for object type values only. Description *string `json:"description,omitempty"` // String representation of the object. Overflow bool `json:"overflow"` // True iff some of the properties or entries of the original object did not fit. Properties []PropertyPreview `json:"properties"` // List of the properties. Entries []EntryPreview `json:"entries,omitempty"` // List of the entries. Specified for map and set subtype values only. }
ObjectPreview Object containing abbreviated remote object value.
func (ObjectPreview) String ¶
func (r ObjectPreview) String() string
String returns a human readable string of the object preview.
type PropertyDescriptor ¶
type PropertyDescriptor struct { Name string `json:"name"` // Property name or symbol description. Value *RemoteObject `json:"value,omitempty"` // The value associated with the property. Writable *bool `json:"writable,omitempty"` // True if the value associated with the property may be changed (data descriptors only). Get *RemoteObject `json:"get,omitempty"` // A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). Set *RemoteObject `json:"set,omitempty"` // A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). Configurable bool `json:"configurable"` // True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. Enumerable bool `json:"enumerable"` // True if this property shows up during enumeration of the properties on the corresponding object. WasThrown *bool `json:"wasThrown,omitempty"` // True if the result was thrown during the evaluation. IsOwn *bool `json:"isOwn,omitempty"` // True if the property is owned for the object. Symbol *RemoteObject `json:"symbol,omitempty"` // Property symbol object, if the property is of the symbol type. }
PropertyDescriptor Object property descriptor.
type PropertyPreview ¶
type PropertyPreview struct { Name string `json:"name"` // Property name. Type string `json:"type"` // Object type. Accessor means that the property itself is an accessor property. Value *string `json:"value,omitempty"` // User-friendly property value string. ValuePreview *ObjectPreview `json:"valuePreview,omitempty"` // Nested value preview. Subtype *string `json:"subtype,omitempty"` // Object subtype hint. Specified for object type values only. }
PropertyPreview
func (PropertyPreview) String ¶
func (r PropertyPreview) String() string
String returns a human readable string of the property.
type ReleaseObjectArgs ¶
type ReleaseObjectArgs struct {
ObjectID RemoteObjectID `json:"objectId"` // Identifier of the object to release.
}
ReleaseObjectArgs represents the arguments for ReleaseObject in the Runtime domain.
func NewReleaseObjectArgs ¶
func NewReleaseObjectArgs(objectID RemoteObjectID) *ReleaseObjectArgs
NewReleaseObjectArgs initializes ReleaseObjectArgs with the required arguments.
type ReleaseObjectGroupArgs ¶
type ReleaseObjectGroupArgs struct {
ObjectGroup string `json:"objectGroup"` // Symbolic object group name.
}
ReleaseObjectGroupArgs represents the arguments for ReleaseObjectGroup in the Runtime domain.
func NewReleaseObjectGroupArgs ¶
func NewReleaseObjectGroupArgs(objectGroup string) *ReleaseObjectGroupArgs
NewReleaseObjectGroupArgs initializes ReleaseObjectGroupArgs with the required arguments.
type RemoteObject ¶
type RemoteObject struct { Type string `json:"type"` // Object type. Subtype *string `json:"subtype,omitempty"` // Object subtype hint. Specified for object type values only. ClassName *string `json:"className,omitempty"` // Object class (constructor) name. Specified for object type values only. Value json.RawMessage `json:"value,omitempty"` // Remote object value in case of primitive values or JSON values (if it was requested). UnserializableValue UnserializableValue `json:"unserializableValue,omitempty"` // Primitive value which can not be JSON-stringified does not have value, but gets this property. Description *string `json:"description,omitempty"` // String representation of the object. ObjectID *RemoteObjectID `json:"objectId,omitempty"` // Unique object identifier (for non-primitive values). Preview *ObjectPreview `json:"preview,omitempty"` // Preview containing abbreviated property values. Specified for object type values only. CustomPreview *CustomPreview `json:"customPreview,omitempty"` // }
RemoteObject Mirror object referencing original JavaScript object.
func (RemoteObject) String ¶
func (r RemoteObject) String() string
String returns a human readable string of a runtime object.
type RunScriptArgs ¶
type RunScriptArgs struct { ScriptID ScriptID `json:"scriptId"` // Id of the script to run. ExecutionContextID *ExecutionContextID `json:"executionContextId,omitempty"` // Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. ObjectGroup *string `json:"objectGroup,omitempty"` // Symbolic group name that can be used to release multiple objects. Silent *bool `json:"silent,omitempty"` // In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. IncludeCommandLineAPI *bool `json:"includeCommandLineAPI,omitempty"` // Determines whether Command Line API should be available during the evaluation. ReturnByValue *bool `json:"returnByValue,omitempty"` // Whether the result is expected to be a JSON object which should be sent by value. GeneratePreview *bool `json:"generatePreview,omitempty"` // Whether preview should be generated for the result. AwaitPromise *bool `json:"awaitPromise,omitempty"` // Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. }
RunScriptArgs represents the arguments for RunScript in the Runtime domain.
func NewRunScriptArgs ¶
func NewRunScriptArgs(scriptID ScriptID) *RunScriptArgs
NewRunScriptArgs initializes RunScriptArgs with the required arguments.
func (*RunScriptArgs) SetAwaitPromise ¶
func (a *RunScriptArgs) SetAwaitPromise(awaitPromise bool) *RunScriptArgs
SetAwaitPromise sets the AwaitPromise optional argument. Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error.
func (*RunScriptArgs) SetExecutionContextID ¶
func (a *RunScriptArgs) SetExecutionContextID(executionContextID ExecutionContextID) *RunScriptArgs
SetExecutionContextID sets the ExecutionContextID optional argument. Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
func (*RunScriptArgs) SetGeneratePreview ¶
func (a *RunScriptArgs) SetGeneratePreview(generatePreview bool) *RunScriptArgs
SetGeneratePreview sets the GeneratePreview optional argument. Whether preview should be generated for the result.
func (*RunScriptArgs) SetIncludeCommandLineAPI ¶
func (a *RunScriptArgs) SetIncludeCommandLineAPI(includeCommandLineAPI bool) *RunScriptArgs
SetIncludeCommandLineAPI sets the IncludeCommandLineAPI optional argument. Determines whether Command Line API should be available during the evaluation.
func (*RunScriptArgs) SetObjectGroup ¶
func (a *RunScriptArgs) SetObjectGroup(objectGroup string) *RunScriptArgs
SetObjectGroup sets the ObjectGroup optional argument. Symbolic group name that can be used to release multiple objects.
func (*RunScriptArgs) SetReturnByValue ¶
func (a *RunScriptArgs) SetReturnByValue(returnByValue bool) *RunScriptArgs
SetReturnByValue sets the ReturnByValue optional argument. Whether the result is expected to be a JSON object which should be sent by value.
func (*RunScriptArgs) SetSilent ¶
func (a *RunScriptArgs) SetSilent(silent bool) *RunScriptArgs
SetSilent sets the Silent optional argument. In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.
type RunScriptReply ¶
type RunScriptReply struct { Result RemoteObject `json:"result"` // Run result. ExceptionDetails *ExceptionDetails `json:"exceptionDetails,omitempty"` // Exception details. }
RunScriptReply represents the return values for RunScript in the Runtime domain.
type SetCustomObjectFormatterEnabledArgs ¶
type SetCustomObjectFormatterEnabledArgs struct {
Enabled bool `json:"enabled"` //
}
SetCustomObjectFormatterEnabledArgs represents the arguments for SetCustomObjectFormatterEnabled in the Runtime domain.
func NewSetCustomObjectFormatterEnabledArgs ¶
func NewSetCustomObjectFormatterEnabledArgs(enabled bool) *SetCustomObjectFormatterEnabledArgs
NewSetCustomObjectFormatterEnabledArgs initializes SetCustomObjectFormatterEnabledArgs with the required arguments.
type StackTrace ¶
type StackTrace struct { Description *string `json:"description,omitempty"` // String label of this stack trace. For async traces this may be a name of the function that initiated the async call. CallFrames []CallFrame `json:"callFrames"` // JavaScript function name. Parent *StackTrace `json:"parent,omitempty"` // Asynchronous JavaScript stack trace that preceded this stack, if available. PromiseCreationFrame *CallFrame `json:"promiseCreationFrame,omitempty"` // Creation frame of the Promise which produced the next synchronous trace when resolved, if available. }
StackTrace Call frames for assertions or error messages.
type Timestamp ¶
type Timestamp float64
Timestamp Number of milliseconds since epoch.
func (Timestamp) MarshalJSON ¶
MarshalJSON implements json.Marshaler. Encodes to null if t is zero.
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type UnserializableValue ¶
type UnserializableValue int
UnserializableValue Primitive value which cannot be JSON-stringified.
const ( UnserializableValueNotSet UnserializableValue = iota UnserializableValueInfinity UnserializableValueNaN UnserializableValueNegativeInfinity UnserializableValueNegative0 )
UnserializableValue as enums.
func (UnserializableValue) MarshalJSON ¶
func (e UnserializableValue) MarshalJSON() ([]byte, error)
MarshalJSON encodes enum into a string or null when not set.
func (UnserializableValue) String ¶
func (e UnserializableValue) String() string
func (*UnserializableValue) UnmarshalJSON ¶
func (e *UnserializableValue) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes a string value into a enum.
func (UnserializableValue) Valid ¶
func (e UnserializableValue) Valid() bool
Valid returns true if enum is set.