public interface Runtime
Modifier and Type | Method and Description |
---|---|
AwaitPromiseResult |
awaitPromise(String promiseObjectId)
Add handler to promise with given promise object id.
|
AwaitPromiseResult |
awaitPromise(String promiseObjectId,
Boolean returnByValue,
Boolean generatePreview)
Add handler to promise with given promise object id.
|
CallFunctionOnResult |
callFunctionOn(String objectId,
String functionDeclaration)
Calls function with given declaration on the given object.
|
CallFunctionOnResult |
callFunctionOn(String objectId,
String functionDeclaration,
List<CallArgument> arguments,
Boolean silent,
Boolean returnByValue,
Boolean generatePreview,
Boolean userGesture,
Boolean awaitPromise)
Calls function with given declaration on the given object.
|
CompileScriptResult |
compileScript(String expression,
String sourceURL,
Boolean persistScript)
Compiles expression.
|
CompileScriptResult |
compileScript(String expression,
String sourceURL,
Boolean persistScript,
Integer executionContextId)
Compiles expression.
|
void |
disable()
Disables reporting of execution contexts creation.
|
void |
discardConsoleEntries()
Discards collected exceptions and console API calls.
|
void |
enable()
Enables reporting of execution contexts creation by means of executionContextCreated event.
|
EvaluateResult |
evaluate(String expression)
Evaluates expression on global object.
|
EvaluateResult |
evaluate(String expression,
String objectGroup,
Boolean includeCommandLineAPI,
Boolean silent,
Integer contextId,
Boolean returnByValue,
Boolean generatePreview,
Boolean userGesture,
Boolean awaitPromise)
Evaluates expression on global object.
|
GetPropertiesResult |
getProperties(String objectId)
Returns properties of a given object.
|
GetPropertiesResult |
getProperties(String objectId,
Boolean ownProperties,
Boolean accessorPropertiesOnly,
Boolean generatePreview)
Returns properties of a given object.
|
void |
releaseObject(String objectId)
Releases remote object with given id.
|
void |
releaseObjectGroup(String objectGroup)
Releases all remote objects that belong to a given group.
|
void |
runIfWaitingForDebugger()
Tells inspected instance to run if it was waiting for debugger to attach.
|
RunScriptResult |
runScript(String scriptId)
Runs script with given id in a given context.
|
RunScriptResult |
runScript(String scriptId,
Integer executionContextId,
String objectGroup,
Boolean silent,
Boolean includeCommandLineAPI,
Boolean returnByValue,
Boolean generatePreview,
Boolean awaitPromise)
Runs script with given id in a given context.
|
void |
setCustomObjectFormatterEnabled(Boolean enabled) |
EvaluateResult evaluate(String expression, String objectGroup, Boolean includeCommandLineAPI, Boolean silent, Integer contextId, Boolean returnByValue, Boolean generatePreview, Boolean userGesture, Boolean awaitPromise)
expression
- Expression to evaluate.objectGroup
- Symbolic group name that can be used to release multiple objects.includeCommandLineAPI
- Determines whether Command Line API should be available during the evaluation.silent
- In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException
state.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.returnByValue
- Whether the result is expected to be a JSON object that should be sent by value.generatePreview
- Whether preview should be generated for the result.userGesture
- Whether execution should be treated as initiated by user in the UI.awaitPromise
- Whether execution should await
for resulting value and return once awaited promise is resolved.AwaitPromiseResult awaitPromise(String promiseObjectId, Boolean returnByValue, Boolean generatePreview)
promiseObjectId
- Identifier of the promise.returnByValue
- Whether the result is expected to be a JSON object that should be sent by value.generatePreview
- Whether preview should be generated for the result.CallFunctionOnResult callFunctionOn(String objectId, String functionDeclaration, List<CallArgument> arguments, Boolean silent, Boolean returnByValue, Boolean generatePreview, Boolean userGesture, Boolean awaitPromise)
objectId
- Identifier of the object to call function on.functionDeclaration
- Declaration of the function to call.arguments
- Call arguments. All call arguments must belong to the same JavaScript world as the target object.silent
- In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException
state.returnByValue
- Whether the result is expected to be a JSON object which should be sent by value.generatePreview
- Whether preview should be generated for the result.userGesture
- Whether execution should be treated as initiated by user in the UI.awaitPromise
- Whether execution should await
for resulting value and return once awaited promise is resolved.GetPropertiesResult getProperties(String objectId, Boolean ownProperties, Boolean accessorPropertiesOnly, Boolean generatePreview)
objectId
- Identifier of the object to return properties for.ownProperties
- If true, returns properties belonging only to the element itself, not to its prototype chain.accessorPropertiesOnly
- If true, returns accessor properties (with getter/setter) only; internal properties are not returned either.generatePreview
- Whether preview should be generated for the results.void releaseObject(String objectId)
objectId
- Identifier of the object to release.void releaseObjectGroup(String objectGroup)
objectGroup
- Symbolic object group name.void runIfWaitingForDebugger()
void enable()
void disable()
void discardConsoleEntries()
void setCustomObjectFormatterEnabled(Boolean enabled)
CompileScriptResult compileScript(String expression, String sourceURL, Boolean persistScript, Integer executionContextId)
expression
- Expression to compile.sourceURL
- Source url to be set for the script.persistScript
- Specifies whether the compiled script should be persisted.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.RunScriptResult runScript(String scriptId, Integer executionContextId, String objectGroup, Boolean silent, Boolean includeCommandLineAPI, Boolean returnByValue, Boolean generatePreview, Boolean awaitPromise)
scriptId
- Id of the script to run.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.objectGroup
- Symbolic group name that can be used to release multiple objects.silent
- In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException
state.includeCommandLineAPI
- Determines whether Command Line API should be available during the evaluation.returnByValue
- Whether the result is expected to be a JSON object which should be sent by value.generatePreview
- Whether preview should be generated for the result.awaitPromise
- Whether execution should await
for resulting value and return once awaited promise is resolved.EvaluateResult evaluate(String expression)
expression
- Expression to evaluate.AwaitPromiseResult awaitPromise(String promiseObjectId)
promiseObjectId
- Identifier of the promise.CallFunctionOnResult callFunctionOn(String objectId, String functionDeclaration)
objectId
- Identifier of the object to call function on.functionDeclaration
- Declaration of the function to call.GetPropertiesResult getProperties(String objectId)
objectId
- Identifier of the object to return properties for.CompileScriptResult compileScript(String expression, String sourceURL, Boolean persistScript)
expression
- Expression to compile.sourceURL
- Source url to be set for the script.persistScript
- Specifies whether the compiled script should be persisted.RunScriptResult runScript(String scriptId)
scriptId
- Id of the script to run.Copyright © 2017 WebFolder OÜ. All rights reserved.