Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@mdn/browser-compat-data
Advanced tools
@mdn/browser-compat-data is a comprehensive dataset that provides browser compatibility information for various web technologies, including HTML, CSS, JavaScript, and more. It is maintained by MDN Web Docs and is useful for developers who need to know which features are supported by different browsers.
Check CSS property support
This feature allows you to check the browser compatibility of a specific CSS property. In this example, it checks the compatibility of the 'border-radius' property.
const bcd = require('@mdn/browser-compat-data');
const css = bcd.css.properties;
console.log(css['border-radius']);
Check JavaScript API support
This feature allows you to check the browser compatibility of a specific JavaScript API. In this example, it checks the compatibility of the 'Promise' API.
const bcd = require('@mdn/browser-compat-data');
const js = bcd.javascript.builtins;
console.log(js['Promise']);
Check HTML element support
This feature allows you to check the browser compatibility of a specific HTML element. In this example, it checks the compatibility of the 'video' element.
const bcd = require('@mdn/browser-compat-data');
const html = bcd.html.elements;
console.log(html['video']);
caniuse-lite is a smaller, more compact version of the data from caniuse.com. It provides browser support tables for various web technologies. Compared to @mdn/browser-compat-data, caniuse-lite is more lightweight and focuses on providing quick access to compatibility data.
browserslist is a tool that allows you to specify which browsers you want to support in your project. It uses data from caniuse-lite to determine browser compatibility. While @mdn/browser-compat-data provides detailed compatibility information, browserslist helps you configure your project to support specific browsers.
@mdn/browser-compat-data
https://github.com/mdn/browser-compat-data
This repository contains compatibility data for Web technologies. Browser compatibility data describes which platforms (where "platforms" are usually, but not always, web browsers) support particular Web APIs.
This data can be used in documentation, to build compatibility tables listing browser support for APIs. For example: Browser support for WebExtension APIs.
Read how this project is governed.
Chat on chat.mozilla.org#mdn.
You can install @mdn/browser-compat-data
as a node package.
npm install @mdn/browser-compat-data
const bcd = require('@mdn/browser-compat-data');
bcd.css.properties.background;
// returns a compat data object (see schema)
The @mdn/browser-compat-data
package contains a tree of objects, with support and browser data objects at their leaves. There are over 12,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:
api
Data for Web API features.
browsers
Data for browser and engine releases. See the browser schema for details.
css
Data for CSS features, including:
at-rules
- at-rulesproperties
- propertiesselectors
- selectors (such as basic selectors, combinators, or pseudo elements)types
- types for rule valueshtml
Data for HTML features, including:
elements
- Elementsglobal_attributes
- Global attributesmanifest
- Web App manifest keyshttp
Data for HTTP features, including:
headers
- Request and response headersmethods
- Request methodsstatus
- Status codesjavascript
Data for JavaScript language features, including:
builtins
- Built-in objectsclasses
- Class definition featuresfunctions
- Function featuresgrammar
- Language grammaroperators
- Mathematical and logical operatorsstatements
- Language statements and expressionsmathml
Data for MathML features, including:
elements
- Elementssvg
Data for SVG features, including:
attributes
- Attributeselements
- Elementswebdriver
Data for WebDriver features.
webextensions
Data for WebExtensions features, including:
api
- WebExtension-specific APIsmanifest
- manifest.json
keysFor the purposes of semantic versioning (SemVer), the public API consists of:
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.
If you find a problem, please file a bug.
We're very happy to accept contributions to this data. See Contributing to browser-compat-data for more information.
Here are some projects using the data, as an npm module or directly:
Thanks to:
The BrowserStack Open Source Program for testing services |
Sauce Labs Open Source for testing services |
FAQs
Browser compatibility data provided by MDN Web Docs
We found that @mdn/browser-compat-data demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.