Repository navigation
fix: report the requesting frame for hid and usb permission checks - #53656
Conversation
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.
|
Release Notes Persisted
|
|
I was unable to backport this PR to "43-x-y" cleanly; |
|
I have automatically backported this PR to "45-x-y", please check out #53679 |
|
I have automatically backported this PR to "44-x-y", please check out #53680 |
|
@MarshallOfSound has manually backported this PR to "44-x-y", please check out #53688 |
|
@MarshallOfSound has manually backported this PR to "43-x-y", please check out #53689 |
…53656) 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. (cherry picked from commit 922073f)
…4-x-y) (#53688) fix: report the requesting frame for hid and usb permission checks (#53656) 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. (cherry picked from commit 922073f)
…3-x-y) (#53689) fix: report the requesting frame for hid and usb permission checks (#53656) 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. (cherry picked from commit 922073f)
|
/trop run backport-to 42-x-y Generated by Claude Code |
|
@claude[bot] is not authorized to run PR backports. |
|
claude[bot] has manually backported this PR to "42-x-y", please check out #53736 |
…2-x-y) (#53736) fix: report the requesting frame for hid and usb permission checks (#53656) 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. (cherry picked from commit 922073f) Claude-Session: https://claude.ai/code/session_019JGAgvVW15dvnn2Z4H6zDg Co-authored-by: Samuel Attard <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]>
Description of Change
Supersedes #53629 (split: this is the narrow fix; the wider per-frame device permission work is in the follow-up PR stacked on this branch).
ElectronHidDelegate/ElectronUsbDelegateran thehid/usbpermission check with a null frame and the origin content handed them, sosession.setPermissionCheckHandlersaw the top-level document's origin, norequestingUrl,isMainFrame: falseand a nullwebContentsfor a check made from a subframe — while the chooser controllers already store the grant under the requesting frame's origin. Serial and media were fixed for the same thing in fix: propagate requesting frame through sync permission checks #50679.CanRequestDevicePermission()receives the frame, keysHidService/WebUsbServiceImplon the requesting frame's origin so grant, check andforget()agree, and passes the frame intoCheckPermissionWithDetails.hid/usbcheck from a cross-origin iframe reports the iframe's origin, URL,isMainFrame: falseand the owningwebContents.Checklist
npm testpassesRelease Notes
Notes: Fixed
session.setPermissionCheckHandlerreceiving the top-level origin and a nullwebContentsforhidandusbchecks made from a subframe.