INNER CODE UNIT · Python

__init__

feder-cr/invisible_playwright · src/invisible_playwright/_juggler/server.py:196

    def __init__(self, server, frame: "FrameDispatcher", object_id: str,
                 preview: str = "", *, world: str = "utility") -> None:
        self.frame = frame
        self.object_id = object_id
        # ⛔ WHICH WORLD THE objectId BELONGS TO. Almost every handle here is
        # born in the utility world, where the rest of this server lives. One
        # is not: `waitForFunction` runs the CALLER'S expression in the page's
        # own world, so its result exists only there - and an objectId is not
        # portable between worlds. A handle that lies about its world does not
        # fail loudly: Juggler answers that the object does not exist, on a
        # call the user thinks succeeded.
        self.world = world
        # ⛔ THE PARENT IS THE FRAME, NOT THE PAGE, and the parent is not
        # bookkeeping: `_element_handle.py` does `self._frame = cast("Frame",
        # parent)` - the client learns which frame a handle belongs to from the
        # guid tree and from nothing else. With the Page as parent, every call
        # that reads a timeout off that frame died with
        # `'Page' object has no attribute '_timeout'`, an error that names

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…