Skip to content

fix: report the requesting frame for hid and usb permission checks - #53679

Merged
MarshallOfSound merged 1 commit into
45-x-yfrom
trop/45-x-y-bp-fix-report-the-requesting-frame-for-hid-and-usb-permission-checks-1788795962489
Sep 7, 2026
Merged

MarshallOfSound merged 1 commit into
45-x-yfrom
trop/45-x-y-bp-fix-report-the-requesting-frame-for-hid-and-usb-permission-checks-1788795962489

Conversation

@trop

@trop trop Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Backport of #53656

See that PR for details.

Notes: Fixed session.setPermissionCheckHandler receiving the top-level origin and a null webContents for hid and usb checks made from a subframe.

ElectronHidDelegate and ElectronUsbDelegate ran the hid/usb permission
check with a null frame and the origin content handed them, so
session.setPermissionCheckHandler saw the top-level document's origin,
no requestingUrl, isMainFrame false and a null webContents for a check
made from a subframe, while the chooser controllers already store the
grant under the requesting frame's origin.

Carry https://crrev.com/c/8364427 so CanRequestDevicePermission()
receives the frame, key HidService/WebUsbServiceImpl on the requesting
frame's origin so grant, check and forget() agree, and pass the frame
into CheckPermissionWithDetails, matching serial and media.

Co-authored-by: Samuel Attard <[email protected]>
@trop
trop Bot requested a review from a team as a code owner September 7, 2026 15:46
@trop
trop Bot requested a review from MarshallOfSound September 7, 2026 15:46
@trop trop Bot added 45-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Sep 7, 2026
@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) September 7, 2026 15:47
@MarshallOfSound MarshallOfSound self-assigned this Sep 7, 2026
@MarshallOfSound
MarshallOfSound merged commit 36042b2 into 45-x-y Sep 7, 2026
96 checks passed
@MarshallOfSound
MarshallOfSound deleted the trop/45-x-y-bp-fix-report-the-requesting-frame-for-hid-and-usb-permission-checks-1788795962489 branch September 7, 2026 17:47
@release-clerk

release-clerk Bot commented Sep 7, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed session.setPermissionCheckHandler receiving the top-level origin and a null webContents for hid and usb checks made from a subframe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

45-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant