mokr.frame.manager
Module Contents
Classes
This class is an assistant class that helps with |
Attributes
- mokr.frame.manager.LOGGER
- class mokr.frame.manager.FrameManager(client: mokr.connection.DevtoolsConnection, frame_tree: dict, page: mokr.browser.page.Page)
Bases:
pyee.EventEmitterThis class is an assistant class that helps with
mokr.frame.Framemanagement by creating them and by managing `mokr.execution.ExecutionContext`s.- Parameters:
client (DevtoolsConnection) –
mokr.execution.ExecutionContextof themokr.browser.Pagethat spawned this.frame_tree (dict) – A representation of the hierarchy of remote frames on a page.
page (Page) – The spawning
mokr.browser.Pageobject.
- property main_frame: mokr.frame.frame.Frame | None
The main remote frame (top of the frame tree).
- frames() list[mokr.frame.frame.Frame]
A list of all
mokr.frame.Frameobjects under this manager.
- frame(frame_id: str) mokr.frame.frame.Frame | None
Return a frame with the given
frame_id, if any.- Parameters:
frame_id (str) – Remote frame identifier.
- Returns:
mokr.frame.Frame, if any match givenframe_id.- Return type:
Frame | None
- execution_context_by_id(context_id: str) mokr.execution.context.ExecutionContext
Get a
mokr.execution.ExecutionContextunder this manager.- Parameters:
context_id (str) – Target context identifier.
- Raises:
ElementHandleError – Raised if no context matches
context_id.- Returns:
mokr.execution.ExecutionContextcreatedby this
FrameManagerwith givencontext_id.
- Return type:
- create_javascript_handle(context: mokr.execution.context.ExecutionContext, remote_object: dict = None) mokr.execution.context.JavascriptHandle
Create a
mokr.execution.JavascriptHandlefor given context.- Parameters:
context (ExecutionContext) –
mokr.execution.ExecutionContextto pass into initialisation.remote_object (dict, optional) – Remote object to be represented by new
mokr.execution.JavascriptHandle. Defaults to None.
- Returns:
_description_
- Return type: