(
self, parent: ChannelOwner, type: str, guid: str, initializer: Dict
)
| 158 | touchscreen: Touchscreen |
| 159 | |
| 160 | def __init__( |
| 161 | self, parent: ChannelOwner, type: str, guid: str, initializer: Dict |
| 162 | ) -> None: |
| 163 | super().__init__(parent, type, guid, initializer) |
| 164 | self._browser_context = cast("BrowserContext", parent) |
| 165 | self.keyboard = Keyboard(self._channel) |
| 166 | self.mouse = Mouse(self._channel) |
| 167 | self.touchscreen = Touchscreen(self._channel) |
| 168 | |
| 169 | self._main_frame: Frame = from_channel(initializer["mainFrame"]) |
| 170 | self._main_frame._page = self |
| 171 | self._frames = [self._main_frame] |
| 172 | self._viewport_size: Optional[ViewportSize] = initializer.get("viewportSize") |
| 173 | self._is_closed = False |
| 174 | self._workers: List["Worker"] = [] |
| 175 | self._bindings: Dict[str, Any] = {} |
| 176 | self._routes: List[RouteHandler] = [] |
| 177 | self._web_socket_routes: List[WebSocketRouteHandler] = [] |
| 178 | self._owned_context: Optional["BrowserContext"] = None |
| 179 | self._timeout_settings: TimeoutSettings = TimeoutSettings( |
| 180 | self._browser_context._timeout_settings |
| 181 | ) |
| 182 | self._video: Video = Video( |
| 183 | self, |
| 184 | cast(Optional[Artifact], from_nullable_channel(initializer.get("video"))), |
| 185 | ) |
| 186 | self._screencast: Screencast = Screencast(self) |
| 187 | self._local_storage = WebStorage(self, "local") |
| 188 | self._session_storage = WebStorage(self, "session") |
| 189 | self._opener = cast("Page", from_nullable_channel(initializer.get("opener"))) |
| 190 | self._close_reason: Optional[str] = None |
| 191 | self._close_was_called = False |
| 192 | self._har_routers: List[HarRouter] = [] |
| 193 | self._locator_handlers: Dict[str, LocatorHandler] = {} |
| 194 | |
| 195 | self._channel.on( |
| 196 | "bindingCall", |
| 197 | lambda params: self._on_binding(from_channel(params["binding"])), |
| 198 | ) |
| 199 | self._channel.on("close", lambda _: self._on_close()) |
| 200 | self._channel.on("crash", lambda _: self._on_crash()) |
| 201 | self._channel.on("download", lambda params: self._on_download(params)) |
| 202 | self._channel.on( |
| 203 | "fileChooser", |
| 204 | lambda params: self.emit( |
| 205 | Page.Events.FileChooser, |
| 206 | FileChooser( |
| 207 | self, from_channel(params["element"]), params["isMultiple"] |
| 208 | ), |
| 209 | ), |
| 210 | ) |
| 211 | self._channel.on( |
| 212 | "frameAttached", |
| 213 | lambda params: self._on_frame_attached(from_channel(params["frame"])), |
| 214 | ) |
| 215 | self._channel.on( |
| 216 | "frameDetached", |
| 217 | lambda params: self._on_frame_detached(from_channel(params["frame"])), |
no test coverage detected