INNER CODE UNIT · Python

op_json_value

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

    def op_json_value(self, params: Dict) -> Any:
        """The handle's value, read IN THE WORLD THE HANDLE LIVES IN.

        ⛔ Almost every handle here is a utility-world one and takes the first
        branch. The exception is what `waitForFunction` hands back: the
        caller's expression ran in the page's own world, so its result exists
        only there. Reading it through the utility world asks Juggler about an
        objectId that context has never seen, and the answer is not an error a
        caller can act on - it is an evaluation failure on a handle they were
        just given.
        """
        if getattr(self, "world", "utility") == "main":
            return {"value": _serialize(self.injected.json_value_in(
                self.frame.frame_id, "main", self.object_id))}
        return {"value": _serialize(self.injected.call(
            self.frame.frame_id, "(injected, o) => o",
            {"objectId": self.object_id}))}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…