← Back to Target domain

Target.createBrowserContext

Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than one.

Domain: Target stable

Parameters

NameTypeDescription
disposeOnDetach (optional)booleanIf specified, disposes this context when debugging session disconnects.
proxyServer (optional)stringProxy server, similar to the one passed to --proxy-server
proxyBypassList (optional)stringProxy bypass list, similar to the one passed to --proxy-bypass-list
originsWithUniversalNetworkAccess (optional)arrayAn optional list of origins to grant unlimited cross-origin access to. Parts of the URL other than those constituting origin are ignored.

Returns

NameTypeDescription
browserContextIdBrowser.BrowserContextIDThe id of the context created.

Example Request

{
  "id": 1,
  "method": "Target.createBrowserContext"
}

Example Response

{
  "id": 1,
  "result": {
    "browserContextId": "browserContextId-value"
  }
}

Usage in Node.js

const result = await send('Target.createBrowserContext');
console.log(result);
// {"browserContextId": "browserContextId-value"}