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

Method addIntercept

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

* Adds a network intercept. * * @param {AddInterceptParameters} params - The parameters for the network intercept. * @returns {Promise } - A promise that resolves to the added intercept's id. * @throws {Error} - If params is not an instance of AddInterceptParameters.

(params)

Source from the content-addressed store, hash-verified

199 * @throws {Error} - If params is not an instance of AddInterceptParameters.
200 */
201 async addIntercept(params) {
202 if (!(params instanceof AddInterceptParameters)) {
203 throw new Error(`Params must be an instance of AddInterceptParameters. Received:'${params}'`)
204 }
205
206 const command = {
207 method: 'network.addIntercept',
208 params: Object.fromEntries(params.asMap()),
209 }
210
211 let response = await this.bidi.send(command)
212
213 return response.result.intercept
214 }
215
216 /**
217 * Removes an intercept.

Callers 4

#initMethod · 0.45
network_test.jsFile · 0.45

Calls 2

asMapMethod · 0.65
sendMethod · 0.65

Tested by

no test coverage detected