coderef

CPU compute pressureLimited availability

The PressureObserver API monitors CPU load, allowing you to adjust workloads in response to available computing resources. Also known as the Compute Pressure API.

Not yet supported in all major browsers — check the table and provide a fallback.

Browser support

DesktopChrome
1–124Not supported
125+Supportedsince May 14, 2024
Current: 155
Edge
12–124Not supported
125+Supportedsince May 17, 2024
Current: 154
Firefox
✕Not supportedup to 157
Current: 157
Safari
✕Not supportedup to 27
Current: 27
MobileChrome Android
✕Not supportedup to 155
Current: 155
Firefox Android
✕Not supportedup to 157
Current: 157
Safari iOS
✕Not supportedup to 27
Current: 27

How to use

Not supported in Firefox, Safari, Chrome Android, Firefox Android, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.

Example

Full syntax and examples are on MDN: PressureObserver.

Feature detection

JS · check before using
if ("allow" in document.createElement("iframe")) {
  // the allow attribute/property of <iframe> is supported
}

Sub-features

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

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
PressureObserver125125✕✕✕✕✕
PressureObserver.PressureObserver125125✕✕✕✕✕
PressureObserver.disconnect125125✕✕✕✕✕
PressureObserver.knownSources_static125125✕✕✕✕✕
PressureObserver.observe125125✕✕✕✕✕
PressureObserver.takeRecords125125✕✕✕✕✕
PressureObserver.unobserve125125✕✕✕✕✕
PressureRecord125125✕✕✕✕✕
PressureRecord.source125125✕✕✕✕✕
PressureRecord.state125125✕✕✕✕✕
PressureRecord.time125125✕✕✕✕✕
PressureRecord.toJSON125125✕✕✕✕✕
iframe.allow.compute-pressure125125✕✕✕✕✕
http.headers.Permissions-Policy.compute-pressure125125✕✕✕✕✕