Description
Many WebDriver BiDi methods allow configuring the browser behavior globally or per existing navigable. For example, network.addIntercept
can be used either per navigable(s) or apply globally. Similarly, event subscriptions can be done globally or per navigable. The important requirement for calling these methods for a navigable is that the navigable has to exist.
There is another use case that is currently not covered: how to configure newly created navigables? For example, if you want to subscribe to a subset of events depending on the navigable parameter, there is no way to do it in a race-free way without reloading the newly created navigable. Another example could be network interception and event logging: there could be many navigables in a browser that you do not want to intercept requests in, and dynamically created navigables that you do want to set up interception in.
We could extend the navigable creation algorithm with an ability to pause loading of a navigable, notify the client about the navigable and allow the client to resume loading once the commands configuring the behavior of the newly created navigable have been sent. Ideally, that should extend to worker realms since many workers might not be interesting for interception.