* 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)
| 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. |
no test coverage detected