Enable WebMCP by default and merge feature-list flags - #348
Open
rgarcia wants to merge 2 commits into
Open
Conversation
Chromium 151 ships WebMCP (navigator.modelContext plus the CDP WebMCP domain). Enable it in default launch flags for headless and headful images via --enable-features=WebMCPTesting,DevToolsWebMCPSupport. MergeFlags now unions --enable-features / --disable-features values across base and runtime flag sources into single tokens. Chromium keeps only one value per switch, so without merging, a session-supplied --enable-features would silently drop the image defaults (or vice versa); --disable-features still wins per feature for opt-out.
Add --kernel-disable-features for per-session feature disabling. The launcher folds it into the single --disable-features switch after merging base and runtime flags; the in-image API also translates before writing /chromium/flags so stored files only contain switches Chromium understands. On images predating translation, Chromium ignores the unknown switch, so an opt-out degrades to a no-op instead of last-win clobbering boot-time disable lists.
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.
Summary
Enables WebMCP (Chromium's
navigator.modelContextAPI plus its CDP domain) in default browser launch flags, and makes flag merging feature-list-aware so per-session flags can't silently drop image defaults.Feature strings
Verified against the Chromium 151 sources:
chrome://flags/#enable-webmcp-testingmaps to base featureWebMCPTesting(disabled by default; implies the runtimeWebMCPfeature in the renderer), anddevtools-webmcp-supportmaps toDevToolsWebMCPSupport, which gates registration of the CDPWebMCPdomain handler. Browser-side use also requires theToolspermissions policy (EnableForSelf, depends on WebMCP), which top-level pages get by default.On Chromium 151+,
--enable-features=WebMCPTesting,DevToolsWebMCPSupportturns on both the JS API and the WebMCP CDP domain.What changed
server/cmd/wrapper/chromium.go) and headful defaults (images/chromium-headful/run-{unikernel,docker}.sh): add--enable-features=WebMCPTesting,DevToolsWebMCPSupport.chromiumflags.MergeFlags: union--enable-features/--disable-featuresCSV values across base and runtime sources into single tokens. Chromium keeps only one value per switch, so previously a session-supplied--enable-features=Xwould have silently dropped the image's entire default list (or vice versa). A feature present in both lists resolves to disabled inside Chromium, so sessions can still opt out with--disable-features=WebMCPTesting.chromiumflags.TranslateKernelDisableFeatures: folds a kernel-namespaced--kernel-disable-features=token into the single--disable-featuresswitch at flag-assembly time (both in the launcher and before/chromium/flagsis written). Chromium ignores unknown switches, so on images predating translation the token is inert — an opt-out degrades to a no-op instead of last-win clobbering boot-time disable lists.Tradeoffs
navigator.modelContextto pages, which stock Chrome 151 does not show without an origin trial or experimental-web-platform-features. Sites can detect that surface as a deviation. Callers that need stock-matching behavior can pass--disable-features=WebMCPTesting,DevToolsWebMCPSupport(or the kernel-namespaced token) through existing flag mechanisms; the control plane does this for stealth sessions.Testing
go test ./lib/chromiumflags/— extended table tests for feature-list merging (union across sources, opt-out via disable list, coexistence) and for kernel-token translation (fold into existing list, create list when absent, idempotency). All pass.go build ./...and fullgo test ./...run; remaining failures (display/OTLP/extension e2e tests requiring a running Chromium/X environment) fail identically on main.