codebytere

#54587: docs: document denying a display media request and fix a webview spec

Merged
Created: Sep 30, 2026, 4:30:48 AM
Merged: Sep 30, 2026, 7:32:57 AM
3 comments
Target: main

Description of Change

Two small fixes, one commit each.

Calling the ses.setDisplayMediaRequestHandler callback with null denies the request, and getDisplayMedia() in the page rejects with an AbortError. The docs typed the argument as a plain object, so electron.d.ts rejected callback(null) under strict. This types streams as Object | null and says what null does. The getSources samples in session.md and desktop-capturer.md also never answered the request when getSources rejects, for example when the user cancels the PipeWire picker on Linux, which left getDisplayMedia() pending. Both now call callback(null).

The <webview>.printToPDF() spec for badly typed parameters loaded another webview with the same id on every pass of its loop, so from the second pass on the call was rejected with "webview.printToPDF is not a function" and only the first of the ten parameters reached the type check. It now loads the webview once and requires the rejection to name the parameter. With the headerTemplate check removed, the old spec still passes and the new one fails.

Checklist

Release Notes

Notes: Fixed the setDisplayMediaRequestHandler callback type to accept null.

Backports

44-x-y
Merged
PR Number
#54589
Merged At
Sep 30, 2026, 1:08:45 PM
Released In
Not yet
Release Date
Not yet
45-x-y
Merged
PR Number
#54588
Merged At
Sep 30, 2026, 3:09:12 PM
Released In
Not yet
Release Date
Not yet

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron