Is your feature request related to a problem? Please describe.
In Playwrights Page object (which supposedly the "browser" is a wrapper around in Element 2.x) you can add request interceptors for events request, requestfinishedrequestfailed.
This is helpful for:
a) Logging out request and response info to help debug what is going on
b) Manipulating the request before it is sent out. (for example, conditionally adding request headers based on the target domain of the request.
Describe the solution you'd like
Allow usage of the "on" function to register interceptors on the underlying Page.
There are many other events besides the 3 I described above. So being able to register listeners on all of them would be great.
See Page docs here: https://playwright.dev/docs/api/class-page#page-event-request
Describe alternatives you've considered
I tried to use browser.setExtraHttpHeaders, but since not all of my domains accept the extra HTTP headers, many requests fail.
Also, this doesn't help the debugging case.
Additional context
In general, allowing access to the underlying page object to access anything that Playwright supports would be awesome, as we already have many selectors written in a format that Playwright supports and we are needing to translate them to Flood's locator syntax.
Is your feature request related to a problem? Please describe.
In Playwrights Page object (which supposedly the "browser" is a wrapper around in Element 2.x) you can add request interceptors for events
request
,requestfinished
requestfailed
.This is helpful for: a) Logging out request and response info to help debug what is going on b) Manipulating the request before it is sent out. (for example, conditionally adding request headers based on the target domain of the request.
Describe the solution you'd like
Allow usage of the "on" function to register interceptors on the underlying Page. There are many other events besides the 3 I described above. So being able to register listeners on all of them would be great. See Page docs here: https://playwright.dev/docs/api/class-page#page-event-request
Describe alternatives you've considered
I tried to use
browser.setExtraHttpHeaders
, but since not all of my domains accept the extra HTTP headers, many requests fail. Also, this doesn't help the debugging case.Additional context In general, allowing access to the underlying
page
object to access anything that Playwright supports would be awesome, as we already have many selectors written in a format that Playwright supports and we are needing to translate them to Flood's locator syntax.