Open whimboo opened 2 months ago
Are there any known limitations that might prevent isolating network conditions for individual browsing contexts?
If the question is on the implementation side, on Firefox we support Network Throttling in DevTools scoped by tab. So it shouldn't be an issue.
The Browser Testing and Tools Working Group just discussed emulator - Support emulation of network conditions
.
The Browser Testing and Tools Working Group just discussed Emulation - Support emulation of network conditions
.
Currently, network condition emulation applies globally to the browser (if possible at all), but it would be very useful to emulate network disconnection or throttling for specific browsing contexts (such as tabs or windows) independently.
This feature would provide more control over testing scenarios where individual contexts simulate network loss or restricted connectivity, while other contexts remain unaffected.
Use Cases
Simulating Network Outages for Specific Tabs: Being able to emulate a network outage for a single tab or window while keeping other tabs connected. This is useful for testing progressive web apps (PWAs), handling network errors in single-page applications, or multi-tab synchronization.
Multi-Context Testing: Testing how different contexts react to network issues independently. This is especially useful in applications where different parts of the app rely on separate network calls (e.g., one window working while another goes offline).
Offline-First Applications: Testing apps that are designed to work offline in a more realistic scenario where only certain windows/tabs experience network issues, rather than the entire browser being set to offline mode.
Proposal
Introduce an API to WebDriver BiDi that allows specifying custom network conditions (e.g., offline, latency, download/upload throttling) for specific browsing contexts, rather than affecting the entire browser.
The API could look like:
Benefits
Questions
References