runtime

package
v0.0.0-...-4fec7a0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2017 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Overview

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwaitPromiseRequest

type AwaitPromiseRequest struct {
	// contains filtered or unexported fields
}

func (*AwaitPromiseRequest) Do

func (*AwaitPromiseRequest) GeneratePreview

func (r *AwaitPromiseRequest) GeneratePreview(v bool) *AwaitPromiseRequest

Whether preview should be generated for the result. (optional)

func (*AwaitPromiseRequest) PromiseObjectId

Identifier of the promise.

func (*AwaitPromiseRequest) ReturnByValue

func (r *AwaitPromiseRequest) ReturnByValue(v bool) *AwaitPromiseRequest

Whether the result is expected to be a JSON object that should be sent by value. (optional)

type AwaitPromiseResult

type AwaitPromiseResult struct {
	// Promise result. Will contain rejected value if promise was rejected.
	Result *RemoteObject `json:"result"`

	// Exception details if stack strace is available. (optional)
	ExceptionDetails *ExceptionDetails `json:"exceptionDetails"`
}

type CallArgument

type CallArgument struct {
	// Primitive value. (optional)
	Value interface{} `json:"value,omitempty"`

	// Primitive value which can not be JSON-stringified. (optional)
	UnserializableValue UnserializableValue `json:"unserializableValue,omitempty"`

	// Remote object handle. (optional)
	ObjectId RemoteObjectId `json:"objectId,omitempty"`
}

type CallFrame

type CallFrame struct {
	// JavaScript function name.
	FunctionName string `json:"functionName"`

	// JavaScript script id.
	ScriptId ScriptId `json:"scriptId"`

	// JavaScript script name or url.
	URL string `json:"url"`

	// JavaScript script line number (0-based).
	LineNumber int `json:"lineNumber"`

	// JavaScript script column number (0-based).
	ColumnNumber int `json:"columnNumber"`
}

type CallFunctionOnRequest

type CallFunctionOnRequest struct {
	// contains filtered or unexported fields
}

func (*CallFunctionOnRequest) Arguments

Call arguments. All call arguments must belong to the same JavaScript world as the target object. (optional)

func (*CallFunctionOnRequest) AwaitPromise

func (r *CallFunctionOnRequest) AwaitPromise(v bool) *CallFunctionOnRequest

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. (optional)

func (*CallFunctionOnRequest) Do

func (*CallFunctionOnRequest) FunctionDeclaration

func (r *CallFunctionOnRequest) FunctionDeclaration(v string) *CallFunctionOnRequest

Declaration of the function to call.

func (*CallFunctionOnRequest) GeneratePreview

func (r *CallFunctionOnRequest) GeneratePreview(v bool) *CallFunctionOnRequest

Whether preview should be generated for the result. (optional, experimental)

func (*CallFunctionOnRequest) ObjectId

Identifier of the object to call function on.

func (*CallFunctionOnRequest) ReturnByValue

func (r *CallFunctionOnRequest) ReturnByValue(v bool) *CallFunctionOnRequest

Whether the result is expected to be a JSON object which should be sent by value. (optional)

func (*CallFunctionOnRequest) Silent

In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state. (optional)

func (*CallFunctionOnRequest) UserGesture

Whether execution should be treated as initiated by user in the UI. (optional, experimental)

type CallFunctionOnResult

type CallFunctionOnResult struct {
	// Call result.
	Result *RemoteObject `json:"result"`

	// Exception details. (optional)
	ExceptionDetails *ExceptionDetails `json:"exceptionDetails"`
}

type Client

type Client struct {
	*rpc.Client
}

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.

func (*Client) AwaitPromise

func (d *Client) AwaitPromise() *AwaitPromiseRequest

Add handler to promise with given promise object id.

func (*Client) CallFunctionOn

func (d *Client) CallFunctionOn() *CallFunctionOnRequest

Calls function with given declaration on the given object. Object group of the result is inherited from the target object.

func (*Client) CompileScript

func (d *Client) CompileScript() *CompileScriptRequest

Compiles expression.

func (*Client) Disable

func (d *Client) Disable() *DisableRequest

Disables reporting of execution contexts creation.

func (*Client) DiscardConsoleEntries

func (d *Client) DiscardConsoleEntries() *DiscardConsoleEntriesRequest

Discards collected exceptions and console API calls.

func (*Client) Enable

func (d *Client) Enable() *EnableRequest

Enables reporting of execution contexts creation by means of <code>executionContextCreated</code> event. When the reporting gets enabled the event will be sent immediately for each existing execution context.

func (*Client) Evaluate

func (d *Client) Evaluate() *EvaluateRequest

Evaluates expression on global object.

func (*Client) GetProperties

func (d *Client) GetProperties() *GetPropertiesRequest

Returns properties of a given object. Object group of the result is inherited from the target object.

func (*Client) ReleaseObject

func (d *Client) ReleaseObject() *ReleaseObjectRequest

Releases remote object with given id.

func (*Client) ReleaseObjectGroup

func (d *Client) ReleaseObjectGroup() *ReleaseObjectGroupRequest

Releases all remote objects that belong to a given group.

func (*Client) RunIfWaitingForDebugger

func (d *Client) RunIfWaitingForDebugger() *RunIfWaitingForDebuggerRequest

Tells inspected instance to run if it was waiting for debugger to attach.

func (*Client) RunScript

func (d *Client) RunScript() *RunScriptRequest

Runs script with given id in a given context.

func (*Client) SetCustomObjectFormatterEnabled

func (d *Client) SetCustomObjectFormatterEnabled() *SetCustomObjectFormatterEnabledRequest

(experimental)

type CompileScriptRequest

type CompileScriptRequest struct {
	// contains filtered or unexported fields
}

func (*CompileScriptRequest) Do

func (*CompileScriptRequest) ExecutionContextId

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. (optional)

func (*CompileScriptRequest) Expression

Expression to compile.

func (*CompileScriptRequest) PersistScript

func (r *CompileScriptRequest) PersistScript(v bool) *CompileScriptRequest

Specifies whether the compiled script should be persisted.

func (*CompileScriptRequest) SourceURL

Source url to be set for the script.

type CompileScriptResult

type CompileScriptResult struct {
	// Id of the script. (optional)
	ScriptId ScriptId `json:"scriptId"`

	// Exception details. (optional)
	ExceptionDetails *ExceptionDetails `json:"exceptionDetails"`
}

type ConsoleAPICalledEvent

type ConsoleAPICalledEvent struct {
	// Type of the call.
	Type string `json:"type"`

	// Call arguments.
	Args []*RemoteObject `json:"args"`

	// Identifier of the context where the call was made.
	ExecutionContextId ExecutionContextId `json:"executionContextId"`

	// Call timestamp.
	Timestamp Timestamp `json:"timestamp"`

	// Stack trace captured when the call was made. (optional)
	StackTrace *StackTrace `json:"stackTrace"`

	// 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. (optional, experimental)
	Context string `json:"context"`
}

Issued when console API was called.

type CustomPreview

type CustomPreview struct {
	Header string `json:"header"`

	HasBody bool `json:"hasBody"`

	FormatterObjectId RemoteObjectId `json:"formatterObjectId"`

	BindRemoteObjectFunctionId RemoteObjectId `json:"bindRemoteObjectFunctionId"`

	// (optional)
	ConfigObjectId RemoteObjectId `json:"configObjectId,omitempty"`
}

type DisableRequest

type DisableRequest struct {
	// contains filtered or unexported fields
}

func (*DisableRequest) Do

func (r *DisableRequest) Do() error

type DiscardConsoleEntriesRequest

type DiscardConsoleEntriesRequest struct {
	// contains filtered or unexported fields
}

func (*DiscardConsoleEntriesRequest) Do

type EnableRequest

type EnableRequest struct {
	// contains filtered or unexported fields
}

func (*EnableRequest) Do

func (r *EnableRequest) Do() error

type EntryPreview

type EntryPreview struct {
	// Preview of the key. Specified for map-like collection entries. (optional)
	Key *ObjectPreview `json:"key,omitempty"`

	// Preview of the value.
	Value *ObjectPreview `json:"value"`
}

type EvaluateRequest

type EvaluateRequest struct {
	// contains filtered or unexported fields
}

func (*EvaluateRequest) AwaitPromise

func (r *EvaluateRequest) AwaitPromise(v bool) *EvaluateRequest

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. (optional)

func (*EvaluateRequest) ContextId

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. (optional)

func (*EvaluateRequest) Do

func (r *EvaluateRequest) Do() (*EvaluateResult, error)

func (*EvaluateRequest) Expression

func (r *EvaluateRequest) Expression(v string) *EvaluateRequest

Expression to evaluate.

func (*EvaluateRequest) GeneratePreview

func (r *EvaluateRequest) GeneratePreview(v bool) *EvaluateRequest

Whether preview should be generated for the result. (optional, experimental)

func (*EvaluateRequest) IncludeCommandLineAPI

func (r *EvaluateRequest) IncludeCommandLineAPI(v bool) *EvaluateRequest

Determines whether Command Line API should be available during the evaluation. (optional)

func (*EvaluateRequest) ObjectGroup

func (r *EvaluateRequest) ObjectGroup(v string) *EvaluateRequest

Symbolic group name that can be used to release multiple objects. (optional)

func (*EvaluateRequest) ReturnByValue

func (r *EvaluateRequest) ReturnByValue(v bool) *EvaluateRequest

Whether the result is expected to be a JSON object that should be sent by value. (optional)

func (*EvaluateRequest) Silent

func (r *EvaluateRequest) Silent(v bool) *EvaluateRequest

In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state. (optional)

func (*EvaluateRequest) UserGesture

func (r *EvaluateRequest) UserGesture(v bool) *EvaluateRequest

Whether execution should be treated as initiated by user in the UI. (optional, experimental)

type EvaluateResult

type EvaluateResult struct {
	// Evaluation result.
	Result *RemoteObject `json:"result"`

	// Exception details. (optional)
	ExceptionDetails *ExceptionDetails `json:"exceptionDetails"`
}

type ExceptionDetails

type ExceptionDetails struct {
	// Exception id.
	ExceptionId int `json:"exceptionId"`

	// Exception text, which should be used together with exception object when available.
	Text string `json:"text"`

	// Line number of the exception location (0-based).
	LineNumber int `json:"lineNumber"`

	// Column number of the exception location (0-based).
	ColumnNumber int `json:"columnNumber"`

	// Script ID of the exception location. (optional)
	ScriptId ScriptId `json:"scriptId,omitempty"`

	// URL of the exception location, to be used when the script was not reported. (optional)
	URL string `json:"url,omitempty"`

	// JavaScript stack trace if available. (optional)
	StackTrace *StackTrace `json:"stackTrace,omitempty"`

	// Exception object if available. (optional)
	Exception *RemoteObject `json:"exception,omitempty"`

	// Identifier of the context where exception happened. (optional)
	ExecutionContextId ExecutionContextId `json:"executionContextId,omitempty"`
}

type ExceptionRevokedEvent

type ExceptionRevokedEvent struct {
	// Reason describing why exception was revoked.
	Reason string `json:"reason"`

	// The id of revoked exception, as reported in <code>exceptionUnhandled</code>.
	ExceptionId int `json:"exceptionId"`
}

Issued when unhandled exception was revoked.

type ExceptionThrownEvent

type ExceptionThrownEvent struct {
	// Timestamp of the exception.
	Timestamp Timestamp `json:"timestamp"`

	ExceptionDetails *ExceptionDetails `json:"exceptionDetails"`
}

Issued when exception was thrown and unhandled.

type ExecutionContextCreatedEvent

type ExecutionContextCreatedEvent struct {
	// A newly created execution context.
	Context *ExecutionContextDescription `json:"context"`
}

Issued when new execution context is created.

type ExecutionContextDescription

type ExecutionContextDescription struct {
	// Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed.
	Id ExecutionContextId `json:"id"`

	// Execution context origin.
	Origin string `json:"origin"`

	// Human readable name describing given context.
	Name string `json:"name"`

	// Embedder-specific auxiliary data. (optional)
	AuxData interface{} `json:"auxData,omitempty"`
}

type ExecutionContextDestroyedEvent

type ExecutionContextDestroyedEvent struct {
	// Id of the destroyed context
	ExecutionContextId ExecutionContextId `json:"executionContextId"`
}

Issued when execution context is destroyed.

type ExecutionContextId

type ExecutionContextId int

type ExecutionContextsClearedEvent

type ExecutionContextsClearedEvent struct {
}

Issued when all executionContexts were cleared in browser

type GetPropertiesRequest

type GetPropertiesRequest struct {
	// contains filtered or unexported fields
}

func (*GetPropertiesRequest) AccessorPropertiesOnly

func (r *GetPropertiesRequest) AccessorPropertiesOnly(v bool) *GetPropertiesRequest

If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. (optional, experimental)

func (*GetPropertiesRequest) Do

func (*GetPropertiesRequest) GeneratePreview

func (r *GetPropertiesRequest) GeneratePreview(v bool) *GetPropertiesRequest

Whether preview should be generated for the results. (optional, experimental)

func (*GetPropertiesRequest) ObjectId

Identifier of the object to return properties for.

func (*GetPropertiesRequest) OwnProperties

func (r *GetPropertiesRequest) OwnProperties(v bool) *GetPropertiesRequest

If true, returns properties belonging only to the element itself, not to its prototype chain. (optional)

type GetPropertiesResult

type GetPropertiesResult struct {
	// Object properties.
	Result []*PropertyDescriptor `json:"result"`

	// Internal object properties (only of the element itself). (optional)
	InternalProperties []*InternalPropertyDescriptor `json:"internalProperties"`

	// Exception details. (optional)
	ExceptionDetails *ExceptionDetails `json:"exceptionDetails"`
}

type InspectRequestedEvent

type InspectRequestedEvent struct {
	Object *RemoteObject `json:"object"`

	Hints interface{} `json:"hints"`
}

Issued when object should be inspected (for example, as a result of inspect() command line API call).

type InternalPropertyDescriptor

type InternalPropertyDescriptor struct {
	// Conventional property name.
	Name string `json:"name"`

	// The value associated with the property. (optional)
	Value *RemoteObject `json:"value,omitempty"`
}

type ObjectPreview

type ObjectPreview struct {
	// Object type.
	Type string `json:"type"`

	// Object subtype hint. Specified for <code>object</code> type values only. (optional)
	Subtype string `json:"subtype,omitempty"`

	// String representation of the object. (optional)
	Description string `json:"description,omitempty"`

	// True iff some of the properties or entries of the original object did not fit.
	Overflow bool `json:"overflow"`

	// List of the properties.
	Properties []*PropertyPreview `json:"properties"`

	// List of the entries. Specified for <code>map</code> and <code>set</code> subtype values only. (optional)
	Entries []*EntryPreview `json:"entries,omitempty"`
}

type PropertyDescriptor

type PropertyDescriptor struct {
	// Property name or symbol description.
	Name string `json:"name"`

	// The value associated with the property. (optional)
	Value *RemoteObject `json:"value,omitempty"`

	// True if the value associated with the property may be changed (data descriptors only). (optional)
	Writable bool `json:"writable,omitempty"`

	// A function which serves as a getter for the property, or <code>undefined</code> if there is no getter (accessor descriptors only). (optional)
	Get *RemoteObject `json:"get,omitempty"`

	// A function which serves as a setter for the property, or <code>undefined</code> if there is no setter (accessor descriptors only). (optional)
	Set *RemoteObject `json:"set,omitempty"`

	// True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object.
	Configurable bool `json:"configurable"`

	// True if this property shows up during enumeration of the properties on the corresponding object.
	Enumerable bool `json:"enumerable"`

	// True if the result was thrown during the evaluation. (optional)
	WasThrown bool `json:"wasThrown,omitempty"`

	// True if the property is owned for the object. (optional)
	IsOwn bool `json:"isOwn,omitempty"`

	// Property symbol object, if the property is of the <code>symbol</code> type. (optional)
	Symbol *RemoteObject `json:"symbol,omitempty"`
}

type PropertyPreview

type PropertyPreview struct {
	// Property name.
	Name string `json:"name"`

	// Object type. Accessor means that the property itself is an accessor property.
	Type string `json:"type"`

	// User-friendly property value string. (optional)
	Value string `json:"value,omitempty"`

	// Nested value preview. (optional)
	ValuePreview *ObjectPreview `json:"valuePreview,omitempty"`

	// Object subtype hint. Specified for <code>object</code> type values only. (optional)
	Subtype string `json:"subtype,omitempty"`
}

type ReleaseObjectGroupRequest

type ReleaseObjectGroupRequest struct {
	// contains filtered or unexported fields
}

func (*ReleaseObjectGroupRequest) Do

func (*ReleaseObjectGroupRequest) ObjectGroup

Symbolic object group name.

type ReleaseObjectRequest

type ReleaseObjectRequest struct {
	// contains filtered or unexported fields
}

func (*ReleaseObjectRequest) Do

func (r *ReleaseObjectRequest) Do() error

func (*ReleaseObjectRequest) ObjectId

Identifier of the object to release.

type RemoteObject

type RemoteObject struct {
	// Object type.
	Type string `json:"type"`

	// Object subtype hint. Specified for <code>object</code> type values only. (optional)
	Subtype string `json:"subtype,omitempty"`

	// Object class (constructor) name. Specified for <code>object</code> type values only. (optional)
	ClassName string `json:"className,omitempty"`

	// Remote object value in case of primitive values or JSON values (if it was requested). (optional)
	Value interface{} `json:"value,omitempty"`

	// Primitive value which can not be JSON-stringified does not have <code>value</code>, but gets this property. (optional)
	UnserializableValue UnserializableValue `json:"unserializableValue,omitempty"`

	// String representation of the object. (optional)
	Description string `json:"description,omitempty"`

	// Unique object identifier (for non-primitive values). (optional)
	ObjectId RemoteObjectId `json:"objectId,omitempty"`

	// Preview containing abbreviated property values. Specified for <code>object</code> type values only. (optional, experimental)
	Preview *ObjectPreview `json:"preview,omitempty"`

	// (optional, experimental)
	CustomPreview *CustomPreview `json:"customPreview,omitempty"`
}

type RemoteObjectId

type RemoteObjectId string

type RunIfWaitingForDebuggerRequest

type RunIfWaitingForDebuggerRequest struct {
	// contains filtered or unexported fields
}

func (*RunIfWaitingForDebuggerRequest) Do

type RunScriptRequest

type RunScriptRequest struct {
	// contains filtered or unexported fields
}

func (*RunScriptRequest) AwaitPromise

func (r *RunScriptRequest) AwaitPromise(v bool) *RunScriptRequest

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. (optional)

func (*RunScriptRequest) Do

func (*RunScriptRequest) ExecutionContextId

func (r *RunScriptRequest) ExecutionContextId(v ExecutionContextId) *RunScriptRequest

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. (optional)

func (*RunScriptRequest) GeneratePreview

func (r *RunScriptRequest) GeneratePreview(v bool) *RunScriptRequest

Whether preview should be generated for the result. (optional)

func (*RunScriptRequest) IncludeCommandLineAPI

func (r *RunScriptRequest) IncludeCommandLineAPI(v bool) *RunScriptRequest

Determines whether Command Line API should be available during the evaluation. (optional)

func (*RunScriptRequest) ObjectGroup

func (r *RunScriptRequest) ObjectGroup(v string) *RunScriptRequest

Symbolic group name that can be used to release multiple objects. (optional)

func (*RunScriptRequest) ReturnByValue

func (r *RunScriptRequest) ReturnByValue(v bool) *RunScriptRequest

Whether the result is expected to be a JSON object which should be sent by value. (optional)

func (*RunScriptRequest) ScriptId

func (r *RunScriptRequest) ScriptId(v ScriptId) *RunScriptRequest

Id of the script to run.

func (*RunScriptRequest) Silent

func (r *RunScriptRequest) Silent(v bool) *RunScriptRequest

In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state. (optional)

type RunScriptResult

type RunScriptResult struct {
	// Run result.
	Result *RemoteObject `json:"result"`

	// Exception details. (optional)
	ExceptionDetails *ExceptionDetails `json:"exceptionDetails"`
}

type ScriptId

type ScriptId string

type SetCustomObjectFormatterEnabledRequest

type SetCustomObjectFormatterEnabledRequest struct {
	// contains filtered or unexported fields
}

func (*SetCustomObjectFormatterEnabledRequest) Do

func (*SetCustomObjectFormatterEnabledRequest) Enabled

type StackTrace

type StackTrace struct {
	// String label of this stack trace. For async traces this may be a name of the function that initiated the async call. (optional)
	Description string `json:"description,omitempty"`

	// JavaScript function name.
	CallFrames []*CallFrame `json:"callFrames"`

	// Asynchronous JavaScript stack trace that preceded this stack, if available. (optional)
	Parent *StackTrace `json:"parent,omitempty"`

	// Creation frame of the Promise which produced the next synchronous trace when resolved, if available. (optional, experimental)
	PromiseCreationFrame *CallFrame `json:"promiseCreationFrame,omitempty"`
}

type Timestamp

type Timestamp float64

type UnserializableValue

type UnserializableValue string

Jump to

Keyboard shortcuts

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