browsingContext.activate commandThe browsingContext.activate command of the browsingContext module brings a top-level context to the foreground and gives it focus.
{
"method": "browsingContext.activate",
"params": {
"context": "93ee5bd6-d256-4608-a002-9a8995cc0e5f"
}
}The params field contains:
contextA string that contains the ID of the top-level context to bring to the foreground and give focus. Context IDs are returned by commands such as browsingContext.getTree.
The result field in the response is an empty object ({}).
invalid argumentA required parameter is missing or has an invalid type. This error is also returned when the context specified by context is not a top-level context.
no such frameNo context with the given context ID is found.
unsupported operationThe browser cannot bring the context to the foreground.
The following example shows how to activate a background tab.
With a WebDriver BiDi connection and an active session, suppose you create a tab in the background using browsingContext.create with background: true, which returns the context ID of the tab. Send the following message to activate it:
{
"id": 1,
"method": "browsingContext.activate",
"params": {
"context": "5e5e96e8-5247-4f22-9b35-a4a2d841cbaa"
}
}The browser brings the tab to the foreground and responds as follows:
{
"id": 1,
"type": "success",
"result": {}
}browsingContext.close commandbrowsingContext.create commandbrowsingContext.getTree command