[chrome] Add IOS to runtime.PlatformOs enum#74923
Conversation
Safari on iOS/iPadOS reports `runtime.getPlatformInfo().os` as `"ios"`, but the type definition was missing this value. Ref: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/PlatformOs#ios Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@rxliuli Thank you for submitting this PR! This is a live comment that I will keep updated. 1 package in this PRCode ReviewsBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged. You can test the changes of this PR in the Playground. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. InactiveThis PR has been inactive for 15 days — please try to get reviewers! Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 74923,
"author": "rxliuli",
"headCommitOid": "1beaa3ff686021c56d5281032639f9d3cd7dd32c",
"mergeBaseOid": "a61c3f39f0e22b0a6abd5208cddc68f06b50450f",
"lastPushDate": "2026-04-27T03:23:24.000Z",
"lastActivityDate": "2026-05-10T13:59:50.000Z",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"tooManyCommits": false,
"tooManyReviews": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "chrome",
"kind": "edit",
"files": [
{
"path": "types/chrome/index.d.ts",
"kind": "definition"
},
{
"path": "types/chrome/test/index.ts",
"kind": "test"
}
],
"owners": [
"matthewkimber",
"otiai10",
"sreimer15",
"MatCarlson",
"ekinsol",
"echoabstract",
"spasma",
"bdbai",
"JasonXian",
"usertim",
"idan315",
"nicolas377",
"idosal",
"fregante",
"erwanjugand"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [],
"mainBotCommentID": 4323929524,
"ciResult": "pass"
} |
|
🔔 @matthewkimber @otiai10 @sreimer15 @matcarlson @ekinsol @EchoAbstract @spasma @bdbai @JasonXian @userTim @idan315 @nicolas377 @idosal @fregante @erwanjugand — please review this PR in the next few days. Be sure to explicitly select |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@rxliuli The CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! Note: builds that are failing do not end up on the list of PRs for the DT maintainers to review. |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| /** Specifies the Fuchsia operating system. */ | ||
| FUCHSIA = "fuchsia", | ||
| /** Specifies the iOS operating system. */ | ||
| IOS = "ios", |
There was a problem hiding this comment.
The official Google Chrome Developers documentation does not list ios in PlatformOs.
It is worth noting that the Mozilla Developer Network documentation does not accurately reflect that of Google Chrome Developers.
Do you have a runtime example that demonstrates its presence?
There was a problem hiding this comment.
Could you test using chrome instead of browser ?
There was a problem hiding this comment.
From what I understand, Safari exposes a chrome alias derived from browser
On iOS, the runtime is not Chromium but WebKit, and @types/chrome is focused around Chromium.
I support adding an ios value to simplify the developer experience, but since this is out of scope for @types/chrome, I would like to get another maintainer’s opinion on this.
There was a problem hiding this comment.
The source seems quite clear IMO, so I agree that this is out of scope for the chrome types. Chrome extensions do not natively work on iOS platforms due to apple's security restrictions (though Apple seems to be experimenting with the idea of adding it sometime in the future).
There was a problem hiding this comment.
Mainly because the wxt cross-platform extension framework also depends on this project, that's why I ended up here. I originally submitted a PR at wxt-dev/wxt#2308, and the project author told me to come here instead.
@aklinker1 What do you think — should it still be added in wxt?
There was a problem hiding this comment.
I suppose you could use wxt and then the xcode converter to build a safari extension. However if we did support that, we'd need to support the full browser API (see Erwan's comment earlier). I'm personally of the opinion that @types/chrome is specifically for Chromium APIs, and I'm not even too sure we should have exported browser, since that can cause some confusion in what the types are doing. I would personally boot this issue downstream to wxt.
There was a problem hiding this comment.
I'm not going to maintain an entire browser API schema separately in WXT, so I you'll either need to patch the package in your extension or ignore the type error @rxliuli
|
Re-ping @matthewkimber, @otiai10, @sreimer15, @matcarlson, @ekinsol, @EchoAbstract, @spasma, @bdbai, @JasonXian, @userTim, @idan315, @nicolas377, @idosal, @fregante, @erwanjugand: This PR has been out for over a week, yet I haven't seen any reviews. Could someone please give it some attention? Thanks! |



Summary
Add
IOS = "ios"tochrome.runtime.PlatformOsenum.Safari on iOS/iPadOS reports
runtime.getPlatformInfo().osas"ios", but the type definition was missing this value, causing TypeScript errors when comparing against it.Reference
🤖 Generated with Claude Code