mokr.frame.manager ================== .. py:module:: mokr.frame.manager Attributes ---------- .. autoapisummary:: mokr.frame.manager.LOGGER Classes ------- .. autoapisummary:: mokr.frame.manager.FrameManager Module Contents --------------- .. py:data:: LOGGER .. py:class:: FrameManager(client: mokr.connection.DevtoolsConnection, frame_tree: dict, page: mokr.browser.page.Page) Bases: :py:obj:`pyee.EventEmitter` This class is an assistant class that helps with `mokr.frame.Frame` management by creating them and by managing `mokr.execution.ExecutionContext`s. :param client: `mokr.execution.ExecutionContext` of the `mokr.browser.Page` that spawned this. :type client: DevtoolsConnection :param frame_tree: A representation of the hierarchy of remote frames on a page. :type frame_tree: dict :param page: The spawning `mokr.browser.Page` object. :type page: Page .. py:property:: main_frame :type: mokr.frame.frame.Frame | None The main remote frame (top of the frame tree). .. py:method:: frames() -> list[mokr.frame.frame.Frame] A list of all `mokr.frame.Frame` objects under this manager. :returns: All `mokr.frame.Frame`s controlled by this class. :rtype: list[Frame] .. py:method:: frame(frame_id: str) -> mokr.frame.frame.Frame | None Return a frame with the given `frame_id`, if any. :param frame_id: Remote frame identifier. :type frame_id: str :returns: `mokr.frame.Frame`, if any match given `frame_id`. :rtype: Frame | None .. py:method:: execution_context_by_id(context_id: str) -> mokr.execution.context.ExecutionContext Get a `mokr.execution.ExecutionContext` under this manager. :param context_id: Target context identifier. :type context_id: str :raises ElementHandleError: Raised if no context matches `context_id`. :returns: `mokr.execution.ExecutionContext` created by this `FrameManager` with given `context_id`. :rtype: ExecutionContext .. py:method:: create_javascript_handle(context: mokr.execution.context.ExecutionContext, remote_object: dict = None) -> mokr.execution.context.JavascriptHandle Create a `mokr.execution.JavascriptHandle` for given context. :param context: `mokr.execution.ExecutionContext` to pass into initialisation. :type context: ExecutionContext :param remote_object: Remote object to be represented by new `mokr.execution.JavascriptHandle`. Defaults to None. :type remote_object: dict, optional :returns: _description_ :rtype: JavascriptHandle