Skip to content

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

Merged
codebytere merged 2 commits into
mainfrom
docs-deny-display-media-request
Sep 30, 2026
Merged

codebytere merged 2 commits into
mainfrom
docs-deny-display-media-request

Conversation

@codebytere

@codebytere codebytere commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

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.

@codebytere codebytere added documentation 📓 semver/patch backwards-compatible bug fixes target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. target/45-x-y PR should also be added to the "45-x-y" branch. labels Sep 30, 2026
… checks

The spec loaded another <webview id="webview"> on every pass of its loop, so
from the second pass on `webview` named a collection of elements and the call
was rejected with "webview.printToPDF is not a function". Only the first of
the ten parameters was checked. Load the webview once, and require the
rejection to name the parameter.
@codebytere codebytere changed the title docs: document how to deny a display media request docs: document denying a display media request and fix a webview spec Sep 30, 2026
@codebytere codebytere removed the target/43-x-y PR should also be added to the "43-x-y" branch. label Sep 30, 2026
@codebytere
codebytere merged commit bc8e748 into main Sep 30, 2026
79 checks passed
@codebytere
codebytere deleted the docs-deny-display-media-request branch September 30, 2026 12:32
@release-clerk

release-clerk Bot commented Sep 30, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed the setDisplayMediaRequestHandler callback type to accept null.

@trop

trop Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "45-x-y", please check out #54588

@trop

trop Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "44-x-y", please check out #54589

@trop trop Bot added in-flight/44-x-y merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. and removed target/45-x-y PR should also be added to the "45-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. in-flight/44-x-y in-flight/45-x-y labels Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

46-x-y documentation 📓 merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants