Skip to content

Add isChromeOS to platforms.ts and context. - #309097

Merged
Dmitriy Vasyura (dmitrivMS) merged 3 commits into
microsoft:mainfrom
jmymay:is-chrome-os
Sep 6, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 3 commits into
microsoft:mainfrom
jmymay:is-chrome-os

Conversation

@jmymay

Copy link
Copy Markdown
Contributor

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.

Copilot AI review requested due to automatic review settings April 10, 2026 20:07
@jmymay

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="Google"

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 export isChromeOS.
  • Add isChromeOS as a constant in the context key expression system.
  • Introduce IsChromeOSContext as a RawContextKey for 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.

@vs-code-engineering

vs-code-engineering Bot commented Apr 10, 2026 •

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Benjamin Pasero (@bpasero)

Matched files:

  • src/vs/workbench/browser/contextkeys.ts

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit cf84cd4 into microsoft:main Sep 6, 2026
53 of 54 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.137.0 milestone Sep 6, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Oct 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants