v151 · security · feature detection

Algorithm Support Probe

The update adds a static, synchronous SubtleCrypto.supports(operation, algorithm) method. Before this, the only way to feature-detect an algorithm was to actually attempt an operation and catch the rejection — asynchronous and wasteful. Now you can branch instantly. This tool calls the real method live and builds a support matrix from what your browser reports.

checking for SubtleCrypto.supports…

full support matrix

algorithm \ operation

the code

// Static and synchronous — no promise, no try/catch needed
if (globalThis.SubtleCrypto?.supports?.("encapsulateBits", "ML-KEM-768")) {
  // use post-quantum key encapsulation
} else {
  // fall back to ECDH
}

// Choose the best available password KDF up front
const kdf = globalThis.SubtleCrypto?.supports?.("importKey", "Argon2id") ? "Argon2id" : "PBKDF2";

supports is defined as a static method on the SubtleCrypto interface object, so you call it there, not on the crypto.subtle instance. Accessing the constructor through globalThis.SubtleCrypto?. matters: optional chaining directly from an undeclared SubtleCrypto identifier can still throw a ReferenceError in browsers without that global.

see also

references