* Gets the list of all user contexts. * @returns {Promise } A promise that resolves to an array of user context ids.
()
| 54 | * @returns {Promise<string[]>} A promise that resolves to an array of user context ids. |
| 55 | */ |
| 56 | async getUserContexts() { |
| 57 | const command = { |
| 58 | method: 'browser.getUserContexts', |
| 59 | params: {}, |
| 60 | } |
| 61 | |
| 62 | let response = await this.bidi.send(command) |
| 63 | |
| 64 | let userContexts = [] |
| 65 | |
| 66 | let userContextsArray = response.result.userContexts |
| 67 | |
| 68 | for (let userContextJson of userContextsArray) { |
| 69 | userContexts.push(userContextJson.userContext) |
| 70 | } |
| 71 | |
| 72 | return userContexts |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Removes a user context. |
no test coverage detected