JavaScript PushManager supportedContentEncodings Property

Beginner
5 min read
Updated: Nov 2026
4 examples
Property

Definition

PushManager.supportedContentEncodings is a static, read-only property. It returns a frozen array of content encodings the browser can use to encrypt push message payloads (MDN). Browsers must support aes128gcm (RFC 8291).

Read the notes below before you rely on this property. Prefer feature detection when support is limited.

Syntax

Use PushManager.supportedContentEncodings. Start with this line.

JavaScript
PushManager.supportedContentEncodings
CallWhat it does
PushManager.supportedContentEncodingsPrimary signature.

Built into the browser. Read PushManager.supportedContentEncodings on the PushManager interface — no import required.

Library declarations
JavaScript
PushManager.supportedContentEncodings

Parameters

ParameterDescription
Secure contextRequired. HTTPS or localhost

Return Value

Return ValueDescription
*The current value of PushManager.supportedContentEncodings.

JavaScript Examples

Example 1 — Read supportedContentEncodings

Log the static array your browser exposes.

JavaScript
if ("PushManager" in window && PushManager.supportedContentEncodings) {
  console.log(PushManager.supportedContentEncodings);
} else {
  console.log("supportedContentEncodings not available");
}
Try It Yourself

How It Works

  1. Feature-detect. Confirm PushManager and the property exist.
  2. Read the static property. No parentheses — it is not a method.
  3. Expect a string array. Modern browsers usually return ["aes128gcm"].
  4. Handle missing support. Older engines may omit the property entirely.

Example 2 — Prefer aes128gcm

MDN: user agents must support the aes128gcm coding from RFC 8291.

JavaScript
const encodings = PushManager.supportedContentEncodings || [];
const prefersAes = encodings.includes("aes128gcm");

console.log("encodings:", encodings);
console.log("aes128gcm:", prefersAes);
Try It Yourself

How It Works

  1. Read safely. Fall back to [] if the property is missing.
  2. Check with includes. Look for the required aes128gcm coding.
  3. Log both facts. The full list and a boolean keep debugging simple.
  4. Use that coding on the server. Match encryption to what the browser listed.

Example 3 — Frozen Array Throws TypeError

MDN: the returned array is frozen — setting an index throws.

JavaScript
const encodings = PushManager.supportedContentEncodings;

console.log(Object.isFrozen(encodings)); // true

try {
  encodings[0] = "custom";
} catch (err) {
  console.log(err.name); // TypeError
}
Try It Yourself

How It Works

  1. Read the array. Same static property as before.
  2. Check frozen. Object.isFrozen should be true.
  3. Try a write. Assigning encodings[0] is not allowed.
  4. Catch TypeError. Treat the list as read-only and copy it if you need a mutable version.

Example 4 — Send Encoding with Subscription Data

MDN approach: bundle encodings with endpoint/keys for the app server.

JavaScript
// After subscribe() — demo shape (no real network call)
const subscription = {
  endpoint: "https://push.example.com/abc",
  keys: { p256dh: "…", auth: "…" }
};

const payload = {
  endpoint: subscription.endpoint,
  keys: subscription.keys,
  encoding: PushManager.supportedContentEncodings
};

console.log(JSON.stringify(payload, null, 2));
// In production: fetch("/api/push", { method: "POST", body: JSON.stringify(payload) })
Try It Yourself

How It Works

  1. Collect subscription data. Endpoint plus p256dh / auth keys (from a real PushSubscription).
  2. Attach encodings. Add PushManager.supportedContentEncodings so the server knows the coding.
  3. Serialize. JSON.stringify makes a POST body your API can store.
  4. Encrypt on the server. Use that coding and set the Content-Encoding header when sending the push.

Browser Support

PushManager.supportedContentEncodings is Baseline 2025 — newly available since January 2025 (MDN). It needs a secure context and may be missing in older browsers.

✓ Baseline 2025 · Newly available

PushManager.supportedContentEncodings

Static frozen array of push payload encodings (usually aes128gcm).

New Baseline 2025 support
Google Chrome Supported · current · secure context
Full support
Mozilla Firefox Supported · current · secure context
Full support
Apple Safari Supported · modern Safari / iOS
Full support
Microsoft Edge Supported · current · secure context
Full support
Opera Follow Chromium
Full support
Internet Explorer No Push API
Not supported
supportedContentEncodings Newly available

Bottom line: Use current Chrome, Firefox, Safari, and Edge. Always feature-detect, prefer aes128gcm, and send the encoding list to your app server with the subscription.

Frequently Asked Questions

A read-only frozen array of strings naming content encodings the browser supports for encrypting push message payloads. It usually contains just one value: "aes128gcm" (MDN).
No. MDN marks it as Baseline 2025 (newly available since January 2025). It is not Deprecated, Experimental, or Non-standard.
Static. Read it on the PushManager interface itself: PushManager.supportedContentEncodings — not on registration.pushManager.
The server must encrypt push payloads with a coding the browser supports, and it sets that coding in the Content-Encoding HTTP header on each push message (MDN).
No. MDN says the array is frozen. Attempting to set a value throws TypeError.
User agents must support the aes128gcm content coding defined in RFC 8291. Older codings may also appear in the array (MDN).

Next: getSubscription()

Learn how to restore push UI by reading the current subscription.

getSubscription() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

9 people found this page helpful