Before relying on a Web API, check whether it works across the browsers your users run. Baseline is a WebDX Community Group initiative that reports cross-browser availability for web platform features. It helps distinguish an API supported across major browsers from one that still needs feature detection, a fallback, or progressive enhancement. section 2.2.1
Baseline uses two availability statuses:
- Newly available means a feature works in the latest stable Chrome, Edge, Firefox, and Safari. Older browser versions may still lack it. section 2.2.1
- Widely available means it has remained Newly available across those browsers for 30 months. It can then be relied on for the vast majority of traffic without fallbacks. section 2.2.1
- A label such as Baseline 2024 identifies features that became Newly available during 2024, not features that became Widely available that year. section 2.2.1
Use Baseline alongside MDN Web Docs and CanIUse when choosing APIs. Availability is not the only condition for success: some browser APIs require HTTPS or localhost, and an unavailable API still calls for a deliberate fallback or graceful degradation. section 2.2.1 section 6.3
if ('permissions' in navigator) {
navigator.permissions.query({name: "geolocation"})
.then(console.log);
}
This Permissions API check shows feature detection in practice: the query runs only when `navigator.permissions` exists. It does not replace checking whether the API suits the browsers and conditions your application supports. section 2.2.1
