| 671 | await self._channel.send("hideHighlight", None) |
| 672 | |
| 673 | async def add_init_script( |
| 674 | self, script: str = None, path: Union[str, Path] = None |
| 675 | ) -> Disposable: |
| 676 | if path: |
| 677 | script = add_source_url_to_script( |
| 678 | (await async_readfile(path)).decode(), path |
| 679 | ) |
| 680 | if not isinstance(script, str): |
| 681 | raise Error("Either path or script parameter must be specified") |
| 682 | return from_channel( |
| 683 | await self._channel.send("addInitScript", None, dict(source=script)) |
| 684 | ) |
| 685 | |
| 686 | async def route( |
| 687 | self, url: URLMatch, handler: RouteHandlerCallback, times: int = None |