Skip to content

feat(script): evaluate scripts in dedicated worker contexts#2352

Open
gunjanjaswal wants to merge 3 commits into
ChromeDevTools:mainfrom
gunjanjaswal:feat/316-dedicated-worker-execution-context
Open

feat(script): evaluate scripts in dedicated worker contexts#2352
gunjanjaswal wants to merge 3 commits into
ChromeDevTools:mainfrom
gunjanjaswal:feat/316-dedicated-worker-execution-context

Conversation

@gunjanjaswal

Copy link
Copy Markdown

Adds opt-in support for evaluating JavaScript inside a page's dedicated Web Workers, so agents can reach off-main-thread application logic (e.g. Neo.mjs).

Everything is gated behind a new --experimentalWorkers flag and off by default. Worker contexts are never enumerated unless explicitly requested, so baseline token usage is unchanged.

  • list_dedicated_workers lists the selected page's dedicated workers and assigns each a stable worker id.
  • evaluate_script gains an optional workerId argument that resolves the target through the existing Page | Frame | WebWorker union, mirroring the existing serviceWorkerId path (same mutual-exclusivity and no-element-args guards).

Shared workers (#317) are intentionally left out of scope.

Tests cover both tools and the new evaluate path. build, typecheck, eslint, prettier, and npm run gen (docs + CLI reference) all run clean.

Refs #316

Add opt-in support for enumerating and evaluating JavaScript inside a
page's dedicated Web Workers, so agents can inspect off-main-thread app
logic (e.g. Neo.mjs).

The feature is gated behind a new --experimentalWorkers flag and is off
by default, so worker execution contexts are never enumerated unless
explicitly requested and the baseline token usage is unchanged.

- Add list_dedicated_workers tool to list a page's dedicated workers and
  assign each a stable worker id.
- Add an optional workerId argument to evaluate_script that resolves the
  target through the existing Page | Frame | WebWorker union, mirroring
  the existing serviceWorkerId path.

Refs ChromeDevTools#316
…worker-execution-context

# Conflicts:
#	src/McpContext.ts
…worker-execution-context

# Conflicts:
#	src/telemetry/tool_call_metrics.json
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.

1 participant