| 183 | return context |
| 184 | |
| 185 | async def new_page( |
| 186 | self, |
| 187 | viewport: ViewportSize = None, |
| 188 | screen: ViewportSize = None, |
| 189 | noViewport: bool = None, |
| 190 | ignoreHTTPSErrors: bool = None, |
| 191 | javaScriptEnabled: bool = None, |
| 192 | bypassCSP: bool = None, |
| 193 | userAgent: str = None, |
| 194 | locale: str = None, |
| 195 | timezoneId: str = None, |
| 196 | geolocation: Geolocation = None, |
| 197 | permissions: Sequence[str] = None, |
| 198 | extraHTTPHeaders: Dict[str, str] = None, |
| 199 | offline: bool = None, |
| 200 | httpCredentials: HttpCredentials = None, |
| 201 | deviceScaleFactor: float = None, |
| 202 | isMobile: bool = None, |
| 203 | hasTouch: bool = None, |
| 204 | colorScheme: ColorScheme = None, |
| 205 | forcedColors: ForcedColors = None, |
| 206 | contrast: Contrast = None, |
| 207 | reducedMotion: ReducedMotion = None, |
| 208 | acceptDownloads: bool = None, |
| 209 | defaultBrowserType: str = None, |
| 210 | proxy: ProxySettings = None, |
| 211 | recordHarPath: Union[Path, str] = None, |
| 212 | recordHarOmitContent: bool = None, |
| 213 | recordVideoDir: Union[Path, str] = None, |
| 214 | recordVideoSize: ViewportSize = None, |
| 215 | storageState: Union[StorageState, str, Path] = None, |
| 216 | baseURL: str = None, |
| 217 | strictSelectors: bool = None, |
| 218 | serviceWorkers: ServiceWorkersPolicy = None, |
| 219 | recordHarUrlFilter: Union[Pattern[str], str] = None, |
| 220 | recordHarMode: HarMode = None, |
| 221 | recordHarContent: HarContentPolicy = None, |
| 222 | clientCertificates: List[ClientCertificate] = None, |
| 223 | ) -> Page: |
| 224 | params = locals_to_params(locals()) |
| 225 | |
| 226 | async def inner() -> Page: |
| 227 | context = await self.new_context(**params) |
| 228 | page = await context.new_page() |
| 229 | page._owned_context = context |
| 230 | context._owner_page = page |
| 231 | return page |
| 232 | |
| 233 | return await self._connection.wrap_api_call(inner, title="Create page") |
| 234 | |
| 235 | async def close(self, reason: str = None) -> None: |
| 236 | self._close_reason = reason |