MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / close

Method close

javascript/selenium-webdriver/bidi/network.js:401–422  ·  view source on GitHub ↗

* Unsubscribes from network events for all browsing contexts. * @returns {Promise } A promise that resolves when the network connection is closed.

()

Source from the content-addressed store, hash-verified

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
425async function getNetworkInstance(driver, browsingContextIds = null) {

Callers

nothing calls this directly

Calls 1

unsubscribeMethod · 0.45

Tested by

no test coverage detected