coderef

Subresource integrityBaseline · Widely available

Subresource integrity verifies that a resource, such as script served from a content delivery network, matches a known cryptographic hash. Also known as SRI.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Apr 30, 2018. Widely available since Oct 30, 2020.

Browser support

DesktopChrome
1–45Not supported
46+Supportedsince Oct 13, 2015
Current: 155
Edge
12–16Not supported
17+Supportedsince Apr 30, 2018
Current: 154
Firefox
1–50Not supported
51+Supportedsince Jan 24, 2017
Current: 157
Safari
1–11Not supported
11.1+Supportedsince Apr 12, 2018
Current: 27
MobileChrome Android
18–45Not supported
46+Supportedsince Oct 14, 2015
Current: 155
Firefox Android
4–50Not supported
51+Supportedsince Jan 24, 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: integrity.

Feature detection

JS · check before using
if ("HTMLLinkElement" in globalThis && "integrity" in HTMLLinkElement.prototype) {
  // HTMLLinkElement.integrity is available
}

Sub-features

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

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
HTMLLinkElement.integrity45174311.1454311.3
HTMLScriptElement.integrity45174311.1454311.3
Request.integrity46145110.1465110.3
link.integrity45174311.1454311.3
script.integrity45174311.1454311.3