async def evaluate(self, expression: str, arg: Serializable = None, force_expr: bool = None) -> Any: if not is_function_body(expression): force_expr = True return parse_result(await self._channel.send( "evaluateExpression", dict( expression=expression, isFunction=not (force_expr), arg=serialize_argument(arg), ), ))
async def evalOnSelectorAll( self, selector: str, expression: str, arg: Serializable = None, force_expr: bool = None, ) -> Any: return parse_result(await self._channel.send( "evalOnSelectorAll", dict( selector=selector, expression=expression, isFunction=not (force_expr), arg=serialize_argument(arg), ), ))
async def send(self, method: str, params: Dict = None) -> Dict: result = await self._channel.send("send", locals_to_params(locals())) return parse_result(result)
def _on_event(self, params: Any) -> None: self.emit(params["method"], parse_result(params["params"]))