INNER CODE UNIT · Python

op_get_property

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

    def op_get_property(self, params: Dict) -> Any:
        object_id = self.injected.call(
            self.frame.frame_id,
            "(injected, o, n) => o[n]",
            {"objectId": self.object_id}, params["name"], by_value=False)
        handle = ElementHandleDispatcher(self.server, self.frame, object_id)
        return {"handle": handle.channel}

    def op_get_property_list(self, params: Dict) -> Any:
        """⛔ ONE HANDLE PER PROPERTY, and each one holds its value alive. On a
        large object this is the most expensive call in the file, which is why
        `json_value` exists and should be preferred when the values are
        serialisable."""
        names = self.injected.call(
            self.frame.frame_id,
            "(injected, o) => o === Object(o) ? Object.keys(o) : []",
            {"objectId": self.object_id}) or []
        out = []

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…