docs(route): add note about unroute (#6019)

This commit is contained in:
Max Schmitt 2021-03-31 18:23:17 +02:00 committed by GitHub
parent 2f5bf04f51
commit 26f9e29623
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 0 deletions

View file

@ -719,6 +719,8 @@ browser.close()
Page routes (set up with [`method: Page.route`]) take precedence over browser context routes when request matches both
handlers.
To remove a route with its handler you can use [`method: BrowserContext.unroute`].
:::note
Enabling routing disables http cache.
:::

View file

@ -2132,6 +2132,8 @@ browser.close()
Page routes take precedence over browser context routes (set up with [`method: BrowserContext.route`]) when request
matches both handlers.
To remove a route with its handler you can use [`method: Page.unroute`].
:::note
Enabling routing disables http cache.
:::

6
types/types.d.ts vendored
View file

@ -2351,6 +2351,9 @@ export interface Page {
* [browserContext.route(url, handler)](https://playwright.dev/docs/api/class-browsercontext#browsercontextrouteurl-handler))
* when request matches both handlers.
*
* To remove a route with its handler you can use
* [page.unroute(url[, handler])](https://playwright.dev/docs/api/class-page#pageunrouteurl-handler).
*
* > NOTE: Enabling routing disables http cache.
* @param url A glob pattern, regex pattern or predicate receiving [URL] to match while routing.
* @param handler handler function to route the request.
@ -5012,6 +5015,9 @@ export interface BrowserContext {
* Page routes (set up with [page.route(url, handler)](https://playwright.dev/docs/api/class-page#pagerouteurl-handler))
* take precedence over browser context routes when request matches both handlers.
*
* To remove a route with its handler you can use
* [browserContext.unroute(url[, handler])](https://playwright.dev/docs/api/class-browsercontext#browsercontextunrouteurl-handler).
*
* > NOTE: Enabling routing disables http cache.
* @param url A glob pattern, regex pattern or predicate receiving [URL] to match while routing.
* @param handler handler function to route the request.