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

Method getUserContexts

javascript/selenium-webdriver/bidi/browser.js:56–73  ·  view source on GitHub ↗

* Gets the list of all user contexts. * @returns {Promise } A promise that resolves to an array of user context ids.

()

Source from the content-addressed store, hash-verified

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.

Callers 2

browser_test.jsFile · 0.45
browser_test.jsFile · 0.45

Calls 1

sendMethod · 0.65

Tested by

no test coverage detected