Repository navigation
Add isChromeOS to platforms.ts and context. - #309097
Merged
Merged
Conversation
Contributor
Author
|
@microsoft-github-policy-service agree company="Google" |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class ChromeOS detection to the shared platform utilities and exposes it as a context key so contributors can target ChromeOS explicitly in when clauses (e.g. keybindings).
Changes:
- Detect ChromeOS in web environments via
navigator.userAgent(CrOS) and exportisChromeOS. - Add
isChromeOSas a constant in the context key expression system. - Introduce
IsChromeOSContextas aRawContextKeyfor discoverability/metadata.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/vs/platform/contextkey/common/contextkeys.ts | Adds a new exported RawContextKey for isChromeOS. |
| src/vs/platform/contextkey/common/contextkey.ts | Registers isChromeOS as a constant so expressions can substitute it. |
| src/vs/base/common/platform.ts | Implements ChromeOS user-agent detection and exports isChromeOS. |
Jeremy Majewski (jmymay)
force-pushed
the
is-chrome-os
branch
from
April 10, 2026 20:18
2752e85 to
c8632b7
Compare
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Benjamin Pasero (@bpasero)Matched files:
|
Jeremy Majewski (jmymay)
force-pushed
the
is-chrome-os
branch
from
April 10, 2026 20:18
c8632b7 to
b1dcced
Compare
Co-authored-by: Copilot <[email protected]>
Dmitriy Vasyura (dmitrivMS)
enabled auto-merge (squash)
September 6, 2026 20:16
Dmitriy Vasyura (dmitrivMS)
approved these changes
Sep 6, 2026
Benjamin Christopher Simmonds (benibenj)
approved these changes
Sep 6, 2026
Dmitriy Vasyura (dmitrivMS)
merged commit Sep 6, 2026
cf84cd4
into
microsoft:main
53 of 54 checks passed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
I personally miss a way to specify keybindings with
"when": "isChromeOS". This PR would allow doing so.Related issue: #247766, and previous PR for detecting ChromeOS under
isLinux: #248134.