MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / closeWebSocket

Method closeWebSocket

javascript/selenium-webdriver/bidi/index.js:321–334  ·  view source on GitHub ↗
(callback)

Source from the content-addressed store, hash-verified

319 this._failPending(new Error('BiDi connection closed before response was received'))
320
321 const closeWebSocket = (callback) => {
322 // don't close if it's already closed
323 if (this._ws.readyState === 3) {
324 callback()
325 } else {
326 // don't notify on user-initiated shutdown ('disconnect' event)
327 this._ws.removeAllListeners('close')
328 this._ws.once('close', () => {
329 this._ws.removeAllListeners()
330 callback()
331 })
332 this._ws.close()
333 }
334 }
335 return new Promise((fulfill, _) => {
336 closeWebSocket(fulfill)
337 })

Callers

nothing calls this directly

Calls 2

closeMethod · 0.65
callbackFunction · 0.50

Tested by

no test coverage detected