Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ getCompatibleVersions({

#### `includeDownstreamBrowsers`

Setting `includeDownstreamBrowsers` to `true` will include browsers outside of the Baseline core browser set where it is possible to map those browsers to an upstream Chromium version:
Setting `includeDownstreamBrowsers` to `true` will include browsers outside of the Baseline core browser set where it is possible to map those browsers to an upstream Chromium or Gecko version:

```javascript
getCompatibleVersions({
Expand All @@ -159,6 +159,20 @@ getCompatibleVersions({

For more information on downstream browsers, see [the section on downstream browsers](#downstream-browsers) below.

#### `includeKaiOS`

KaiOS is an operating system and app framework based on the Gecko engine from Firefox. KaiOS is based on the Gecko engine and feature support can be derived from the upstream Gecko version that each KaiOS version implements. However KaiOS requires other considerations beyond feature compatibility to ensure a good user experience as it runs on device types that do not have either mouse and keyboard or touch screen input in the way that all the other browsers supported by this module do.

```javascript
getCompatibleVersions({
includeDownstreamBrowsers: true,
includeKaiOS: true,
});
```

> [!NOTE]
> Including KaiOS requires you to include all downstream browsers using the `includeDownstreamBrowsers` option.

#### `listAllCompatibleVersions`

Setting `listAllCompatibleVersions` to true will include the minimum versions of each compatible browser, and all the subsequent versions:
Expand Down Expand Up @@ -227,7 +241,7 @@ Browser versions that do not support Widely or Newly available will not include

#### `includeDownstreamBrowsers` (in `getAllVersions()` output)

As with `getCompatibleVersions()`, you can set `includeDownstreamBrowsers` to `true` to include the Chromium downstream browsers [listed below](#list-of-downstream-browsers).
As with `getCompatibleVersions()`, you can set `includeDownstreamBrowsers` to `true` to include the Chromium and Gecko downstream browsers [listed below](#list-of-downstream-browsers).

```javascript
getAllVersions({
Expand All @@ -253,6 +267,17 @@ Downstream browsers include the same properties as core browsers, as well as the
]
```

#### `includeKaiOS` (in `getAllVersions()` output)

As with `getCompatibleVersions()` you can include KaiOS in your output. The same requirement to have `includeDownstreamBrowsers: true` applies.

```javascript
getAllVersions({
includeDownstreamBrowsers: true,
includeKaiOS: true,
});
```

#### `outputFormat`

By default, this function returns an `Array` of `Objects` which can be manipulated in Javascript or output to JSON.
Expand Down Expand Up @@ -374,10 +399,12 @@ Shows UC Browser Mobile 13.8 implementing Chromium 100, and:
Shows Yandex Browser Mobile 24.10 implementing Chromium 128. The Chromium version from this string is mapped to the corresponding Chrome version from MDN `browser-compat-data`.

> [!NOTE]
> Where possible, approximate release dates have been included based on useragents.io "first seen" data. useragents.io does not have "first seen" dates prior to June 2020. However, these browsers' Baseline compatibility is determined by their Chromium version, so their release dates are more informative than critical.
> Where possible, approximate release dates have been included based on useragents.io "first seen" data. useragents.io does not have "first seen" dates prior to June 2020. However, these browsers' Baseline compatibility is determined by their Chromium or Gecko version, so their release dates are more informative than critical.

This data is updated on a daily basis using a [script](https://github.com/web-platform-dx/web-features/tree/main/scripts/refresh-downstream.ts) triggered by a GitHub [action](https://github.com/web-platform-dx/web-features/tree/main/.github/workflows/refresh_downstream.yml). Useragents.io provides a private API for this module which exposes the last 7 days of newly seen user agents for the currently tracked browsers. If a new major version of one of the tracked browsers is encountered with a Chromium version that meets or exceeds the previous latest version of that browser, it is added to the [src/data/downstream-browsers.json](src/data/downstream-browsers.json) file with the date it was first seen by useragents.io as its release date.

KaiOS is an exception - its upstream version mappings are handled separately from the other browsers because they happen very infrequently.

### List of downstream browsers

| Browser | ID | Core | Source |
Expand All @@ -396,6 +423,7 @@ This data is updated on a daily basis using a [script](https://github.com/web-pl
| QQ Browser Mobile | `qq_android` | `false` | useragents.io |
| UC Browser Mobile | `uc_android` | `false` | useragents.io |
| Yandex Browser Mobile | `ya_android` | `false` | useragents.io |
| KaiOS | `kai_os` | `false` | Manual |

> [!NOTE]
> All the non-core browsers currently included implement Chromium. Their inclusion in any of the above methods is based on the Baseline feature set supported by the Chromium version they implement, not their release date.
> All the non-core browsers currently included implement Chromium or Gecko. Their inclusion in any of the above methods is based on the Baseline feature set supported by the Chromium or Gecko version they implement, not their release date.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
"baseline-browser-mapping": "./dist/cli.js"
},
"scripts": {
"fix-cli-permissions": "output=$(npx baseline-browser-mapping 2>&1); [[ \"$output\" =~ sh:\\ ([^:]+):\\ Permission\\ denied ]] && path=\"${BASH_REMATCH[1]}\" && echo \"Permission denied for: $path\" && echo \"Removing $path ...\" && rm -rf \"$path\" || echo \"$output\"",
"test:format": "npx prettier --check .",
"test:lint": "npx eslint .",
"test:bcb": "mkdir test-bcb && cd test-bcb && npm init -y && npm i ../../baseline-browser-mapping browserslist browserslist-config-baseline &&jq '. += {\"browserslist\":[\"extends browserslist-config-baseline\"]}' package.json >p && mv p package.json && npx browserslist && cd ../ && rm -rf test-bcb",
"test:jasmine": "npx jasmine",
"test": "npm run build && rm -rf test-bcb && npm run test:format && npm run test:lint && npx jasmine && npm run test:bcb",
"test": "npm run build && npm run fix-cli-permissions && rm -rf test-bcb && npm run test:format && npm run test:lint && npx jasmine && npm run test:bcb",
"build": "rm -rf dist; npx prettier . --write; rollup -c; rm -rf ./dist/scripts/expose-data.d.ts ./dist/cli.d.ts",
"refresh-downstream": "npx tsx scripts/refresh-downstream.ts",
"refresh-static": "npx tsx scripts/refresh-static.ts",
Expand All @@ -40,7 +41,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@mdn/browser-compat-data": "^6.1.4",
"@mdn/browser-compat-data": "^7.0.0",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.3",
"@types/node": "^22.15.17",
Expand Down
6 changes: 6 additions & 0 deletions scripts/refresh-static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ writeFileSync(
JSON.stringify(
getAllVersions({
includeDownstreamBrowsers: true,
includeKaiOS: true,
}),
),
{ encoding: "utf-8" },
Expand All @@ -59,6 +60,7 @@ writeFileSync(
getAllVersions({
outputFormat: "object",
includeDownstreamBrowsers: true,
includeKaiOS: true,
}),
),
{ encoding: "utf-8" },
Expand All @@ -68,6 +70,7 @@ writeFileSync(
getAllVersions({
outputFormat: "csv",
includeDownstreamBrowsers: true,
includeKaiOS: true,
}).toString(),
{ encoding: "utf-8" },
);
Expand All @@ -77,6 +80,7 @@ writeFileSync(
JSON.stringify(
getAllVersions({
includeDownstreamBrowsers: true,
includeKaiOS: true,
useSupports: true,
}),
),
Expand All @@ -88,6 +92,7 @@ writeFileSync(
getAllVersions({
outputFormat: "object",
includeDownstreamBrowsers: true,
includeKaiOS: true,
useSupports: true,
}),
),
Expand All @@ -98,6 +103,7 @@ writeFileSync(
getAllVersions({
outputFormat: "csv",
includeDownstreamBrowsers: true,
includeKaiOS: true,
useSupports: true,
}).toString(),
{ encoding: "utf-8" },
Expand Down
16 changes: 16 additions & 0 deletions spec/tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,22 @@ describe("getCompatibleVersions default", () => {
).version,
).toBe("20.12");
});

it("Includes KaiOS 3.0 in Baseline 2020 when includeKaiOS: true is used", () => {
expect(
getCompatibleVersions({
includeDownstreamBrowsers: true,
includeKaiOS: true,
targetYear: 2020,
}),
).toContain({
browser: "kai_os",
version: "3.0",
release_date: "2021-09-01",
engine: "Gecko",
engine_version: "84",
});
});
});

describe("getAllVersions default", () => {
Expand Down
3 changes: 3 additions & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const { values } = parseArgs({
"widely-available-on-date": { type: "string" },
"include-downstream-browsers": { type: "boolean" },
"list-all-compatible-versions": { type: "boolean" },
"include-kaios": { type: "boolean" },
help: { type: "boolean", short: "h" },
},
strict: true,
Expand All @@ -32,6 +33,7 @@ Options:
--widely-available-on-date Pass a date in the format 'YYYY-MM-DD' to get versions compatible with Widely
available on the specified date.
--include-downstream-browsers Whether to include browsers that use the same engines as a core Baseline browser.
--include-kaios Whether to include KaiOS in downstream browsers. Requires --include-downstream-browsers.
--list-all-compatible-versions Whether to include only the minimum compatible browser versions or all compatible versions.
-h, --help Show help

Expand All @@ -53,5 +55,6 @@ console.log(
widelyAvailableOnDate: values["widely-available-on-date"],
includeDownstreamBrowsers: values["include-downstream-browsers"],
listAllCompatibleVersions: values["list-all-compatible-versions"],
includeKaiOS: values["include-kaios"],
}),
);
13 changes: 11 additions & 2 deletions src/data/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,6 @@ const data = {
["25.2", "2025-04-24", "u", "b", "132"],
["25.3", "2025-04-23", "u", "b", "132"],
["25.4", "2025-04-23", "u", "b", "134"],
["99.9", "2025-05-27", "u", "b", "800"],
],
},
uc_android: {
Expand Down Expand Up @@ -1402,6 +1401,16 @@ const data = {
["19.2", "2025-07-15", "u", "b", "121"],
],
},
kai_os: {
releases: [
["1.0", "2017-03-01", "u", "g", "37"],
["2.0", "2017-07-01", "u", "g", "48"],
["2.5", "2017-07-01", "u", "g", "48"],
["3.0", "2021-09-01", "u", "g", "84"],
["3.1", "2022-03-01", "u", "g", "84"],
["4.0", "2025-05-01", "u", "g", "123"],
],
},
},
features: [
[
Expand Down Expand Up @@ -5686,5 +5695,5 @@ const data = {
],
],
};
const lastUpdated = 1755785424708;
const lastUpdated = 1756204101749;
export { data, lastUpdated };
51 changes: 44 additions & 7 deletions src/data/downstream-browsers.json
Original file line number Diff line number Diff line change
Expand Up @@ -670,12 +670,6 @@
"engine_version": "134",
"status": "unknown",
"release_date": "2025-04-23"
},
"99.9": {
"engine": "Blink",
"engine_version": "800",
"status": "unknown",
"release_date": "2025-05-27"
}
}
},
Expand Down Expand Up @@ -1562,7 +1556,50 @@
"release_date": "2025-07-15"
}
}
},
"kai_os": {
"name": "KaiOS",
"type": "mobile",
"upstream": "firefox_android",
"releases": {
"1.0": {
"engine": "Gecko",
"engine_version": "37",
"status": "unknown",
"release_date": "2017-03-01"
},
"2.0": {
"engine": "Gecko",
"engine_version": "48",
"status": "unknown",
"release_date": "2017-07-01"
},
"2.5": {
"engine": "Gecko",
"engine_version": "48",
"status": "unknown",
"release_date": "2017-07-01"
},
"3.0": {
"engine": "Gecko",
"engine_version": "84",
"status": "unknown",
"release_date": "2021-09-01"
},
"3.1": {
"engine": "Gecko",
"engine_version": "84",
"status": "unknown",
"release_date": "2022-03-01"
},
"4.0": {
"engine": "Gecko",
"engine_version": "123",
"status": "unknown",
"release_date": "2025-05-01"
}
}
}
},
"lastUpdated": "2025-08-17T14:08:36.165Z"
"lastUpdated": "2025-08-26T11:11:36.165Z"
}
Loading