v159 · dom · media session
IDL contract inspector
Changing undefined setMicrophoneActive(boolean active) to Promise<undefined> setMicrophoneActive(boolean active) changes more than the return value. WebIDL says a promise-returning operation must never throw: argument errors and wrong receivers become rejected promises. This inspector runs every observable consequence against the real methods and classifies each row as matching the spec, matching legacy Chrome, or neither.
Probing this browser…
| Check | Spec / Chrome 159 | Chrome ≤158 | Observed here | Matches |
|---|
why errors move
// Chrome ≤158 (void operation): WebIDL throws synchronously
try { navigator.mediaSession.setMicrophoneActive(); }
catch (e) { e.name } // "TypeError" — caught here
// Chrome 159 (promise operation): WebIDL "converts" the exception
const p = navigator.mediaSession.setMicrophoneActive(); // no throw
p.catch(e => e.name); // "TypeError" — arrives as a rejection
The setScreenshareActive() row is informational: the spec added it alongside the return-type change, but Chromium’s IDL does not expose it, so “absent” is the expected Chrome 159 result and is not counted against this feature.