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

Method addCallback

javascript/selenium-webdriver/bidi/domain.js:81–84  ·  view source on GitHub ↗

* Subscribes `handler` to a BiDi event. All the actual subscription-lifecycle * work — remote subscribe/unsubscribe, per-subscription bookkeeping — lives on * the connection itself (see Index#addCallback in bidi/index.js); Domain only * adds the one thing the connection can't do on its own:

(descriptor, handler)

Source from the content-addressed store, hash-verified

79 * A handle for this subscription — call `unsubscribe()` to stop receiving the event.
80 */
81 async addCallback(descriptor, handler) {
82 const dispatch = descriptor.type === undefined ? handler : (params) => handler(descriptor.type.fromWire(params))
83 return this.#bidi.addCallback(descriptor.method, dispatch)
84 }
85}
86
87module.exports = { Domain, event, DOMAIN_TOKEN }

Callers

nothing calls this directly

Calls 2

fromWireMethod · 0.65
handlerFunction · 0.50

Tested by

no test coverage detected