Toolchange event and permissions policy#179
Merged
Merged
Conversation
beaufortfrancois
suggested changes
May 19, 2026
beaufortfrancois
approved these changes
May 20, 2026
Collaborator
Author
|
Since this PR matches the Chromium behavior and web platform tests I wrote, I'll go ahead and land this. Thanks for the review @beaufortfrancois. |
beckysiegel
pushed a commit
to chromium/chromium
that referenced
this pull request
May 24, 2026
This CL brings Blink up to date with webmachinelearning/webmcp#179, by: - Supporting potentially-trustworthy *origins* (not URLs) in `exposedTo`, closing https://crbug.com/509983801 - Changing the ordering of `exposedTo` process with respect to `options.signal` processing - Using `NotAllowedError` instead of `SecurityError` when the `tools` permission is not present. (Subsequent spec PRs and impl CLs will do this for `getTools()` and `executeTool()`). R=mfoltz Bug: 489045948,509983801 Change-Id: I42d915412a7ef1881c4fa35fe63870979d739921 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7863576 Reviewed-by: Mark Foltz <mfoltz@chromium.org> Commit-Queue: Dominic Farolino <dom@chromium.org> Reviewed-by: Alex Moshchuk <alexmos@chromium.org> Reviewed-by: Mark Pearson <mpearson@chromium.org> Cr-Commit-Position: refs/heads/main@{#1635540}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
May 24, 2026
This CL brings Blink up to date with webmachinelearning/webmcp#179, by: - Supporting potentially-trustworthy *origins* (not URLs) in `exposedTo`, closing https://crbug.com/509983801 - Changing the ordering of `exposedTo` process with respect to `options.signal` processing - Using `NotAllowedError` instead of `SecurityError` when the `tools` permission is not present. (Subsequent spec PRs and impl CLs will do this for `getTools()` and `executeTool()`). R=mfoltz Bug: 489045948,509983801 Change-Id: I42d915412a7ef1881c4fa35fe63870979d739921 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7863576 Reviewed-by: Mark Foltz <mfoltz@chromium.org> Commit-Queue: Dominic Farolino <dom@chromium.org> Reviewed-by: Alex Moshchuk <alexmos@chromium.org> Reviewed-by: Mark Pearson <mpearson@chromium.org> Cr-Commit-Position: refs/heads/main@{#1635540}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
May 24, 2026
This CL brings Blink up to date with webmachinelearning/webmcp#179, by: - Supporting potentially-trustworthy *origins* (not URLs) in `exposedTo`, closing https://crbug.com/509983801 - Changing the ordering of `exposedTo` process with respect to `options.signal` processing - Using `NotAllowedError` instead of `SecurityError` when the `tools` permission is not present. (Subsequent spec PRs and impl CLs will do this for `getTools()` and `executeTool()`). R=mfoltz Bug: 489045948,509983801 Change-Id: I42d915412a7ef1881c4fa35fe63870979d739921 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7863576 Reviewed-by: Mark Foltz <mfoltz@chromium.org> Commit-Queue: Dominic Farolino <dom@chromium.org> Reviewed-by: Alex Moshchuk <alexmos@chromium.org> Reviewed-by: Mark Pearson <mpearson@chromium.org> Cr-Commit-Position: refs/heads/main@{#1635540}
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.
This PR contributes to the following issues:
So far this PR only works on the
registerTool()API, bringing it up to speed with the web platform tests in https://github.com/web-platform-tests/wpt/tree/master/webmcp/imperative. Subsequent PRs will introduce thegetTools()andexecuteTool(), to fully close the above issues.This PR introduces:
registerTool()changes:exposeToorigin list as a tool registration optionhttpsexposed origins; an exception is thrown otherwisetoolchangeevent nametoolchangein all documents in the tree that a tool changes in, in ordertoolchangein unregistration algorithm.This PR does not introduce the "*" or "native-agent" keywords that we've proposed, to control a tool's exposure to the built-in agent. That will also be considered in a follow-up.
Preview | Diff