feat(script): evaluate scripts in dedicated worker contexts#2352
Open
gunjanjaswal wants to merge 3 commits into
Open
feat(script): evaluate scripts in dedicated worker contexts#2352gunjanjaswal wants to merge 3 commits into
gunjanjaswal wants to merge 3 commits into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
--experimentalWorkersflag and off by default. Worker contexts are never enumerated unless explicitly requested, so baseline token usage is unchanged.list_dedicated_workerslists the selected page's dedicated workers and assigns each a stable worker id.evaluate_scriptgains an optionalworkerIdargument that resolves the target through the existingPage | Frame | WebWorkerunion, mirroring the existingserviceWorkerIdpath (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, andnpm run gen(docs + CLI reference) all run clean.Refs #316