랭킹으로 돌아가기

mdn/browser-compat-data

JSONdeveloper.mozilla.org

Browser compatibility data for Web technologies as displayed on MDN

compatibilitycompatdatadatasetjson
스타 성장
스타
5.7k
포크
2.6k
주간 성장
이슈
398
2k4k
2016년 5월2019년 9월2023년 2월2026년 7월
README

@mdn/browser-compat-data

https://github.com/mdn/browser-compat-data

The browser-compat-data ("BCD") project contains machine-readable browser (and JavaScript runtime) compatibility data for Web technologies, such as Web APIs, JavaScript features, CSS properties and more. Our goal is to document accurate compatibility data for Web technologies, so web developers may write cross-browser compatible websites easier. BCD is used in web apps and software such as MDN Web Docs, CanIUse, Visual Studio Code, WebStorm and more.

Read how this project is governed.

Chat with us on Matrix at chat.mozilla.org#mdn!

Are you interested in contributing to this project? Check out the Contributing to browser-compat-data documentation.

[!TIP] Looking for something? Consult the alphabetical index of the project documentation.

Installation and Import

NodeJS

You can install @mdn/browser-compat-data as a node package.

npm install @mdn/browser-compat-data
# ...or...
yarn add @mdn/browser-compat-data

Then, you can import BCD into your project with either import or require():

// ESM with Import Attributes (NodeJS 20+)
import bcd from '@mdn/browser-compat-data' with { type: 'json' };
// ...or...
const { default: bcd } = await import('@mdn/browser-compat-data', {
  with: { type: 'json' },
});

// ...or...

// ESM with Import Assertions (NodeJS 16+)
import bcd from '@mdn/browser-compat-data' assert { type: 'json' };
// ...or...
const { default: bcd } = await import('@mdn/browser-compat-data', {
  assert: { type: 'json' },
});

// ...or...

// ESM Wrapper for older NodeJS versions (NodeJS v12+)
import bcd from '@mdn/browser-compat-data/forLegacyNode';
// ...or...
const { default: bcd } = await import('@mdn/browser-compat-data/forLegacyNode');

// ...or...

// CommonJS Module (Any NodeJS)
const bcd = require('@mdn/browser-compat-data');

Deno/Browsers

You can import @mdn/browser-compat-data using a CDN.

// ESM with Import Attributes (Deno 1.37+)
import bcd from 'https://unpkg.com/@mdn/browser-compat-data' with { type: 'json' };
// ...or...
const { default: bcd } = await import(
  'https://unpkg.com/@mdn/browser-compat-data',
  {
    with: { type: 'json' },
  }
);

// ...or...

// ESM with Import Assertions (Deno 1.17+)
import bcd from 'https://unpkg.com/@mdn/browser-compat-data' assert { type: 'json' };
// ...or...
const { default: bcd } = await import(
  'https://unpkg.com/@mdn/browser-compat-data',
  {
    assert: { type: 'json' },
  }
);

// ...or...

// Fetch Method (Deno 1.0+)
const bcd = await fetch('https://unpkg.com/@mdn/browser-compat-data').then(
  (response) => response.json(),
);

Other Languages

You can obtain the raw compatibility data for @mdn/browser-compat-data using a CDN and loading the data.json file included in releases.

https://unpkg.com/@mdn/browser-compat-data/data.json

Usage

Once you have imported BCD, you can access the compatibility data for any feature by accessing the properties of the dictionary.

// Grab the desired support statement
const support = bcd.css.properties.background.__compat;
// returns a compat data object (see schema)

// You may use any syntax to obtain dictionary items
const support = bcd['api']['Document']['body']['__compat'];

TypeScript Support

BCD exports TypeScript type definitions. Type definitions are automatically generated from the schema definitions.

Package contents

The @mdn/browser-compat-data package contains a tree of objects, with support and browser data objects at their leaves. There are over 15,000 features in the dataset; this documentation highlights significant portions, but many others exist at various levels of the tree.

The definitive description of the format used to represent individual features and browsers is the schema definitions.

Apart from the explicitly documented objects below, feature-level support data may change at any time. See Semantic versioning policy for details.

The package contains the following top-level objects:

__meta

An object containing the following package metadata:

  • version - the package version
  • timestamp - the timestamp of when the package version was built

api

Data for Web API features.

browsers

Data for browsers and JavaScript runtimes. See the browser schema for details.

css

Data for CSS features, including:

  • at-rules - at-rules (e.g. @media)
  • properties - Properties (e.g. background, color, font-variant)
  • selectors - Selectors (such as basic selectors, combinators, or pseudo elements)
  • types - Value types for rule values

html

Data for HTML features, including:

  • elements - Elements
  • global_attributes - Global attributes

http

Data for HTTP features, including:

  • headers - Request and response headers
  • methods - Request methods
  • status - Status codes

javascript

Data for JavaScript language features, including:

  • builtins - Built-in objects
  • classes - Class definition features
  • functions - Function features
  • grammar - Language grammar
  • operators - Mathematical and logical operators
  • statements - Language statements and expressions

manifests

  • webapp - Web App manifest keys

mathml

Data for MathML features, including:

  • elements - Elements

mediatypes

Data for Media types, including:

  • mediatypes/image - Image types

An image type is considered supported if it displays correctly when used in an <img> element's src attribute, or as a CSS background-image.

svg

Data for SVG features, including:

  • attributes - Attributes
  • elements - Elements

webassembly

Data for WebAssembly features.

webdriver

Data for WebDriver features, including:

  • bidi - WebDriver BiDi protocol
  • classic - WebDriver Classic protocol

webextensions

Data for WebExtensions features, including:

  • api - WebExtension-specific APIs
  • manifest - manifest.json keys

Semantic versioning policy

For the purposes of semantic versioning (SemVer), the public API consists of:

  • The high-level namespace objects documented in Package contents
  • The schema definitions for browser and support data structures
  • The TypeScript definitions

The details of browser compatibility change frequently, as browsers ship new features, standards organizations revise specifications, and Web developers discover new bugs. We routinely publish updates to the package to reflect these changes.

You should expect lower-level namespaces, feature data, and browser data to be added, removed, or modified at any time. That said, we strive to communicate changes and preserve backward compatibility; if you rely on a currently undocumented portion of the package and want SemVer to apply to it, please open an issue.

What isn't tracked?

Now that you know what this project is, let's mention what this project isn't. This project is not:

  • An extensive description of every possible detail about a feature in a browser. We do not track UI changes, irrelevant features or irrelevant flag data.
  • A source for custom features added by web frameworks (e.g. React, Vue) or corporate runtimes (e.g. AWS Lambda, Azure Functions).
  • A documentation of screen reader compatibility; for screen reader compatibility, check out https://a11ysupport.io/ instead.
  • The location where Baseline data is hosted; while Baseline pulls from BCD, the Baseline data is managed by the W3C WebDX Community Group on their own GitHub repo.

Issues?

If you find a problem with the compatibility data (such as incorrect version numbers) or there is a new web feature you think we should document, please file a bug.

Contributing

Thank you for your interest in contributing to this project! See Contributing to browser-compat-data for more information.

Projects using the data

Here are some projects using the data, as an npm module or directly:

Acknowledgments

Thanks to:

BrowserStack

The BrowserStack Open Source Program for testing services

Testing Powered By Sauce Labs

Sauce Labs Open Source for testing services

LambdaTest

LambdaTest Open Source for testing services

관련 저장소
symfony/polyfill-mbstring

Symfony polyfill for the Mbstring extension

PHPPackagistMIT Licensesymfonypolyfill
symfony.com/polyfill-mbstring
7.8k39
symfony/polyfill-php72

Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions

MIT Licensecompatibilitycomponent
symfony.com/polyfill-php72
4.7k6
symfony/polyfill-ctype

Symfony polyfill for ctype functions

PHPPackagistMIT Licensesymfonypolyfill
symfony.com/polyfill-ctype
4k6
ThatGuySam/doesitarm

🦾 A list of reported app support for Apple Silicon as well as Apple M4 and M3 Ultra Macs

JavaScriptnpmOtherapple-siliconarm64
doesitarm.com
3.8k212
symfony/polyfill-intl-idn

Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions

PHPPackagistMIT Licensecompatibilitycomponent
symfony.com/polyfill-intl-idn
3.4k8
symfony/polyfill-intl-icu

Symfony polyfill for intl's ICU-related data and classes

PHPPackagistMIT Licensesymfonypolyfill
symfony.com/polyfill-intl-icu
2.6k6
symfony/polyfill-php73

Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions

PHPPackagistMIT Licensesymfonypolyfill
symfony.com/polyfill-php73
2.4k6
PHPCompatibility/PHPCompatibility

PHP Compatibility check for PHP_CodeSniffer

PHPPackagistGNU Lesser General Public License v3.0phpphp-codesniffer
techblog.wimgodden.be/tag/codesniffer/
2.3k204
symfony/polyfill-intl-normalizer

Symfony polyfill for intl's Normalizer class and related functions

PHPPackagistMIT Licensesymfonypolyfill
symfony.com/polyfill-intl-normalizer
2.1k4
elishacloud/dxwrapper

Fixes compatibility issues with older games running on Windows 10/11 by wrapping DirectX dlls. Also allows loading custom libraries with the file extension .asi into game processes.

COthergaminggamedev
1.9k127
symfony/polyfill-iconv

Symfony polyfill for the Iconv extension

PHPPackagistMIT Licensesymfonycomponent
symfony.com/polyfill-iconv
1.8k10
symfony/polyfill-intl-grapheme

Symfony polyfill for intl's grapheme_* functions

PHPPackagistMIT Licensesymfonycomponent
symfony.com/polyfill-intl-grapheme
1.7k5