Skip to content

Commit

Permalink
docs(route): add note about unroute (#6019)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Mar 31, 2021
1 parent 2f5bf04 commit 26f9e29
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/src/api/class-browsercontext.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
:::
Expand Down
2 changes: 2 additions & 0 deletions docs/src/api/class-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
:::
Expand Down
6 changes: 6 additions & 0 deletions types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 26f9e29

Please sign in to comment.