Close the underlying WebSocket connection. This will cause the reader task to gracefully exit when it tries to read the next message from the WebSocket. All of the public APIs (``execute()``, ``listen()``, etc.) will raise ``CdpConnectionClosed`` after the CDP connec
(self)
| 409 | self.sessions = {} |
| 410 | |
| 411 | async def aclose(self): |
| 412 | """Close the underlying WebSocket connection. |
| 413 | |
| 414 | This will cause the reader task to gracefully exit when it tries |
| 415 | to read the next message from the WebSocket. All of the public |
| 416 | APIs (``execute()``, ``listen()``, etc.) will raise |
| 417 | ``CdpConnectionClosed`` after the CDP connection is closed. It |
| 418 | is safe to call this multiple times. |
| 419 | """ |
| 420 | await self.ws.aclose() |
| 421 | |
| 422 | @asynccontextmanager |
| 423 | async def open_session(self, target_id) -> AsyncIterator[CdpSession]: |