mokr.execution.handle.javascript
Module Contents
Classes
Representative of a JavaScript object within the frame. |
Attributes
- mokr.execution.handle.javascript.LOGGER
- class mokr.execution.handle.javascript.JavascriptHandle(context: mokr.execution.context.ExecutionContext, client: mokr.connection.DevtoolsConnection, remote_object: dict)
Representative of a JavaScript object within the frame. JavascriptHandles are created automatically by
mokr.frame.FrameManagerandmokr.browser.WebWorker.- Parameters:
context (ExecutionContext) –
mokr.execution.ExecutionContextof themokr.frame.FrameManagerthat spawned this.client (DevtoolsConnection) – Remote connection from parent.
remote_object (dict) – The raw response from the remote connection representing the object.
- property execution_context: mokr.execution.context.ExecutionContext
Get
mokr.execution.ExecutionContextof this handle.
- async get_property(property_name: str) JavascriptHandle
Get a property of the remote object related to this handle.
- Parameters:
property_name (str) – Name of the target property.
- Returns:
Newly created
JavascriptHandlefrom the result.- Return type:
- async get_properties() dict[str, JavascriptHandle]
Get all properties of the remote object related to this handle.
- Returns:
- Dictionary keyed as “property name” to
newly created `JavascriptHandle`s from the results.
- Return type:
dict[str, JavascriptHandle]
- async json() dict
Get and JSONify the values of the remote object this handle represents.
- Returns:
Dictionary of JSONified values.
- Return type:
dict
- async dispose() None
Stop referencing this handle. Allows it to be garbage-collected by the browser.
- to_string() str
Get a string representation of the remote object this represents.
- Returns:
- String representation of remote object. May contain
object data or just the type.
- Return type:
str