Represents all commands and events of Network module. Described in https://w3c.github.io/webdriver-bidi/#module-network.
Represents a Network object.
| Name | Type | Description |
|---|---|---|
driver | Driver | The driver to fetch the BiDi connection. |
browsingContextIds | Array | An array of browsing context IDs that the network events will be subscribed to. |
Adds a network intercept.
| Name | Type | Description |
|---|---|---|
params | AddInterceptParameters | The parameters for the network intercept. |
Subscribes to the 'network.authRequired' event and handles it with the provided callback.
| Name | Type | Description |
|---|---|---|
callback | function | The callback function to handle the event. |
Subscribes to the 'network.beforeRequestSent' event and handles it with the provided callback.
| Name | Type | Description |
|---|---|---|
callback | function | The callback function to handle the event. |
Cancels the authentication for a specific request.
| Name | Type | Description |
|---|---|---|
requestId | string | The ID of the request to cancel authentication for. |
Unsubscribes from network events for all browsing contexts.
A promise that resolves when the network connection is closed.
Continues the network request with the provided parameters.
| Name | Type | Description |
|---|---|---|
params | ContinueRequestParameters | The parameters for continuing the request. |
If params is not an instance of ContinueRequestParameters.
A promise that resolves when the command is sent.
Continues the network response with the given parameters.
| Name | Type | Description |
|---|---|---|
params | ContinueResponseParameters | The parameters for continuing the response. |
If params is not an instance of ContinueResponseParameters.
A promise that resolves when the command is sent.
Continues the network request with authentication credentials.
| Name | Type | Description |
|---|---|---|
requestId | string | The ID of the request to continue. |
username | string | The username for authentication. |
password | string | The password for authentication. |
Continues the network request with authentication but without providing credentials.
| Name | Type | Description |
|---|---|---|
requestId | string | The ID of the request to continue with authentication. |
Fails a network request.
| Name | Type | Description |
|---|---|---|
requestId | number | The ID of the request to fail. |
Subscribes to the 'network.fetchError' event and handles it with the provided callback.
| Name | Type | Description |
|---|---|---|
callback | function | The callback function to handle the event. |
Provides a response for the network.
| Name | Type | Description |
|---|---|---|
params | ProvideResponseParameters | The parameters for providing the response. |
If params is not an instance of ProvideResponseParameters.
A promise that resolves when the command is sent.
Removes an intercept.
| Name | Type | Description |
|---|---|---|
interceptId | string | The ID of the intercept to be removed. |
Subscribes to the 'network.responseCompleted' event and handles it with the provided callback.
| Name | Type | Description |
|---|---|---|
callback | function | The callback function to handle the event. |
Subscribes to the 'network.responseStarted' event and handles it with the provided callback.
| Name | Type | Description |
|---|---|---|
callback | function | The callback function to handle the event. |
Sets the cache behavior for network requests.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
behavior | string | The cache behavior ("default" or "bypass") | ||
contexts | Array.<string> | <optional> | null | Optional array of browsing context IDs |
If behavior is invalid or context IDs are invalid
A promise that resolves when the cache behavior is set