v159 · dom · media session

Return-shape probe

Each button below makes one real call to navigator.mediaSession.setMicrophoneActive() or setCameraActive() and dissects whatever comes back. Chrome 159 returns a Promise that resolves with undefined; older Chrome returns bare undefined. The call only tells the browser the page’s desired capture state — no camera or microphone is opened and no permission is requested.

Probing this browser…

Make a call

setMicrophoneActive(…)
setCameraActive(…)
call
—
typeof
—
toString tag
—
instanceof Promise
—
settled with
—
settled after
—

Press a button to call the method.

the probe, verbatim

const ret = navigator.mediaSession.setCameraActive(true);

typeof ret                               // "object"     | "undefined"
Object.prototype.toString.call(ret)      // "[object Promise]" | "[object Undefined]"
ret instanceof Promise                   // true (159+)  | false (≤158)

if (ret instanceof Promise) {
  const value = await ret;               // undefined — spec: "resolve p with undefined"
}

Pre-159 ground truth (Chrome 153 headless, this project’s build container): all four calls returned undefined with tag [object Undefined]. The probe compares the actual object, not the user-agent string, so it reports whatever your browser really does.

see also