isSecureContextBaseline · Widely available
The isSecureContext global property is a boolean for whether the current browsing context is secure. This is primarily a check that the page has been served over an HTTPS URL.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Apr 12, 2018. Widely available since Oct 12, 2020.
Browser support
DesktopChrome
1–54Not supported
55+Supportedsince Dec 1, 2016
Current: 155Edge
12–14Not supported
15+Supportedsince Apr 5, 2017
Current: 154Firefox
1–51Not supported
52+Supportedsince Mar 7, 2017
Current: 157Safari
1–11Not supported
11.1+Supportedsince Apr 12, 2018
Current: 27MobileChrome Android
18–54Not supported
55+Supportedsince Dec 6, 2016
Current: 155Firefox Android
4–51Not supported
52+Supportedsince Mar 7, 2017
Current: 157Safari iOS
1–11Not supported
11.3+Supportedsince Mar 29, 2018
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: isSecureContext.
Feature detection
JS · check before using
if ("isSecureContext" in globalThis) {
// isSecureContext is available
} else {
// load a polyfill or use a fallback
}Documentation (MDN)
Specification
Sub-features
Support for each part of the feature (2). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| isSecureContext | 47 | 15 | 49 | 11.1 | 47 | 49 | 11.3 |
| isSecureContext.worker_support | 55 | 15 | 52 | 11.1 | 55 | 52 | 11.3 |