chore: return Promise<any> in {page,context}.unroute (#20135)

This commit is contained in:
Max Schmitt 2023-01-17 19:14:47 +01:00 committed by GitHub
parent 700145e627
commit 341b50fd25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -1287,7 +1287,7 @@ A glob pattern, regex pattern or predicate receiving [URL] used to register a ro
### param: BrowserContext.unroute.handler
* since: v1.8
* langs: js, python
- `handler` ?<[function]\([Route], [Request]\)>
- `handler` ?<[function]\([Route], [Request]\): [Promise<any>|any]>
Optional handler function used to register a routing with [`method: BrowserContext.route`].

View File

@ -3668,7 +3668,7 @@ A glob pattern, regex pattern or predicate receiving [URL] to match while routin
### param: Page.unroute.handler
* since: v1.8
* langs: js, python
- `handler` ?<[function]\([Route], [Request]\)>
- `handler` ?<[function]\([Route], [Request]\): [Promise<any>|any]>
Optional handler function to route the request.

View File

@ -4181,7 +4181,7 @@ export interface Page {
* @param url A glob pattern, regex pattern or predicate receiving [URL] to match while routing.
* @param handler Optional handler function to route the request.
*/
unroute(url: string|RegExp|((url: URL) => boolean), handler?: ((route: Route, request: Request) => void)): Promise<void>;
unroute(url: string|RegExp|((url: URL) => boolean), handler?: ((route: Route, request: Request) => Promise<any>|any)): Promise<void>;
url(): string;
@ -8234,7 +8234,7 @@ export interface BrowserContext {
* @param handler Optional handler function used to register a routing with
* [browserContext.route(url, handler[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-route).
*/
unroute(url: string|RegExp|((url: URL) => boolean), handler?: ((route: Route, request: Request) => void)): Promise<void>;
unroute(url: string|RegExp|((url: URL) => boolean), handler?: ((route: Route, request: Request) => Promise<any>|any)): Promise<void>;
/**
* **NOTE** Only works with Chromium browser's persistent context.