coderef

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: 155
Edge
12–14Not supported
15+Supportedsince Apr 5, 2017
Current: 154
Firefox
1–51Not supported
52+Supportedsince Mar 7, 2017
Current: 157
Safari
1–11Not supported
11.1+Supportedsince Apr 12, 2018
Current: 27
MobileChrome Android
18–54Not supported
55+Supportedsince Dec 6, 2016
Current: 155
Firefox Android
4–51Not supported
52+Supportedsince Mar 7, 2017
Current: 157
Safari iOS
1–11Not supported
11.3+Supportedsince Mar 29, 2018
Current: 27

How 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
}

Sub-features

Support for each part of the feature (2). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
isSecureContext47154911.1474911.3
isSecureContext.worker_support55155211.1555211.3