Repository navigation
fix: propagate requesting frame through sync permission checks - #50686
Merged
Conversation
WebContentsPermissionHelper::CheckPermission was hardcoding GetPrimaryMainFrame() and deriving the requesting origin from web_contents_->GetLastCommittedURL(), so the setPermissionCheckHandler callback always received the top frame's origin and details.isMainFrame/details.requestingUrl always reflected the main frame, even when a cross-origin subframe with allow="serial" or allow="camera; microphone" triggered the check. Thread the requesting RenderFrameHost through CheckPermission, CheckSerialAccessPermission, and CheckMediaAccessPermission so the permission manager receives the real requesting frame. Update the serial delegate and WebContents::CheckMediaAccessPermission callers to pass the frame they already have. Adds a regression test that loads a cross-origin iframe with allow="camera; microphone", calls enumerateDevices() from within the iframe, and asserts the permission check handler receives the iframe origin for requestingOrigin, isMainFrame, and requestingUrl. Co-authored-by: Sam Attard <[email protected]>
5 tasks done
MarshallOfSound
approved these changes
Apr 4, 2026
MarshallOfSound
enabled auto-merge (squash)
April 4, 2026 23:35
MarshallOfSound
deleted the
trop/42-x-y-bp-fix-propagate-requesting-frame-through-sync-permission-checks-1775343576454
branch
April 5, 2026 00:43
|
No Release Notes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #50679
See that PR for details.
Notes: no-notes