Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement route(url, handler[, options]) #10

Open
1 task
robingustafsson opened this issue Sep 30, 2021 · 3 comments
Open
1 task

Implement route(url, handler[, options]) #10

robingustafsson opened this issue Sep 30, 2021 · 3 comments
Labels
async supports async (promises) feature A new feature playwright Issue relating to Playwright compatibility

Comments

@robingustafsson
Copy link
Member

robingustafsson commented Sep 30, 2021

Add support for BrowserContext.route(url, handler[, options]), to enable request interception allowing any request initiated in the browser context to be modified. A request with a matching URL will stall until continued, fulfilled or aborted.

Relevant links:

Tasks:

  • Map Route in the mapping layer.
@robingustafsson robingustafsson added feature A new feature playwright Issue relating to Playwright compatibility labels Sep 30, 2021
@robingustafsson robingustafsson changed the title Implement BrowserContext.route(url, handler[, options]) Implement BrowserContext.route(url, handler[, options]) Nov 12, 2021
@inancgumus inancgumus mentioned this issue Feb 16, 2022
8 tasks
@tmc
Copy link
Contributor

tmc commented May 15, 2023

Relatedly, I think this should be exposed on Page as well.

@inancgumus inancgumus added async supports async (promises) and removed needs async labels Oct 23, 2023
@inancgumus inancgumus added the next Might be eligible for the next planning (not guaranteed!) label Jan 30, 2024
@inancgumus
Copy link
Member

@tom-miseur: This is essentially a way to intercept requests before they get sent, which is useful for setting URL/route-specific headers. With page.setExtraHttpHeaders. You often run into CORS issues as the headers are applied across all requests.

@inancgumus inancgumus changed the title Implement BrowserContext.route(url, handler[, options]) Implement route(url, handler[, options]) Jan 30, 2024
@inancgumus inancgumus removed the next Might be eligible for the next planning (not guaranteed!) label Jun 20, 2024
@gbolo
Copy link

gbolo commented Oct 9, 2024

Wondering if this will also be useful in intercepting requests to favico and aborting them so the logs are not filled with 404s for those calls ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
async supports async (promises) feature A new feature playwright Issue relating to Playwright compatibility
Projects
None yet
Development

No branches or pull requests

4 participants