* Unsubscribes from network events for all browsing contexts. * @returns {Promise } A promise that resolves when the network connection is closed.
()
| 399 | * @returns {Promise<void>} A promise that resolves when the network connection is closed. |
| 400 | */ |
| 401 | async close() { |
| 402 | if ( |
| 403 | this._browsingContextIds !== null && |
| 404 | this._browsingContextIds !== undefined && |
| 405 | this._browsingContextIds.length > 0 |
| 406 | ) { |
| 407 | await this.bidi.unsubscribe( |
| 408 | 'network.beforeRequestSent', |
| 409 | 'network.responseStarted', |
| 410 | 'network.responseCompleted', |
| 411 | 'network.authRequired', |
| 412 | this._browsingContextIds, |
| 413 | ) |
| 414 | } else { |
| 415 | await this.bidi.unsubscribe( |
| 416 | 'network.beforeRequestSent', |
| 417 | 'network.responseStarted', |
| 418 | 'network.responseCompleted', |
| 419 | 'network.authRequired', |
| 420 | ) |
| 421 | } |
| 422 | } |
| 423 | } |
| 424 | |
| 425 | async function getNetworkInstance(driver, browsingContextIds = null) { |
nothing calls this directly
no test coverage detected