Skip to content

Feat/isolated context page routing#1018

Closed
passtas wants to merge 5 commits intoChromeDevTools:mainfrom
passtas:feat/isolated-context-page-routing
Closed

Feat/isolated context page routing#1018
passtas wants to merge 5 commits intoChromeDevTools:mainfrom
passtas:feat/isolated-context-page-routing

Conversation

@passtas
Copy link
Copy Markdown
Contributor

@passtas passtas commented Feb 23, 2026

No description provided.

@google-cla
Copy link
Copy Markdown

google-cla bot commented Feb 23, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@passtas passtas force-pushed the feat/isolated-context-page-routing branch 5 times, most recently from 853b5cb to 1334653 Compare February 23, 2026 10:20
RobertWsp and others added 4 commits February 23, 2026 11:44
…port

Add optional `isolatedContext` parameter to `new_page` tool that creates
pages in isolated browser contexts (separate cookies, storage, WebSocket
connections). This enables testing multi-user scenarios where an LLM needs
simultaneous sessions as different users.

Implementation:
- new_page accepts optional isolatedContext string parameter
- McpContext manages a Map of named BrowserContexts
- Pages created with the same context name share an isolated environment
- Pages list displays context labels for easy identification
- Uses page.browserContext() for reverse-lookup instead of iterating contexts

Closes ChromeDevTools#926
@passtas passtas force-pushed the feat/isolated-context-page-routing branch from 1c14851 to 49e33c5 Compare February 23, 2026 11:12
Add optional `isolatedContext` parameter to all page-dependent tools so
parallel agents can resolve pages by context name instead of relying on
the global selected-page pointer.

When an agent creates a page with `new_page(isolatedContext: "my-agent")`,
all subsequent tool calls can pass `isolatedContext: "my-agent"` to
operate on the correct page without race conditions from other agents
calling `select_page` concurrently.

McpContext tracks per-context selected pages and resolvePageByContext()
looks up the right page by context name.  When the parameter is omitted,
tools fall back to getSelectedPage() (fully backward compatible).

Updated tools: take_screenshot, take_snapshot, wait_for, navigate_page,
resize_page, emulate, click_at, fill, fill_form, upload_file, press_key,
evaluate_script, performance_start_trace, performance_stop_trace,
screencast_start.
@passtas passtas force-pushed the feat/isolated-context-page-routing branch from 49e33c5 to cc95e89 Compare February 23, 2026 11:20
@passtas
Copy link
Copy Markdown
Contributor Author

passtas commented Feb 23, 2026

I'll create new one or reopen once #991 is merged, as this one depends on it

@passtas passtas closed this Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants