Skip to content

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

Closed
trop[bot] wants to merge 1 commit into
44-x-yfrom
trop/44-x-y-bp-fix-report-the-requesting-frame-for-hid-and-usb-permission-checks-1788795964067
Closed

trop[bot] wants to merge 1 commit into
44-x-yfrom
trop/44-x-y-bp-fix-report-the-requesting-frame-for-hid-and-usb-permission-checks-1788795964067

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 44-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

Copy link
Copy Markdown
Member

Superseded by #53688 (manual backport with the Chromium patch regenerated for M152).

auto-merge was automatically disabled September 7, 2026 16:20

Pull request was closed

@trop
trop Bot deleted the trop/44-x-y-bp-fix-report-the-requesting-frame-for-hid-and-usb-permission-checks-1788795964067 branch September 7, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant