feat(iframe): support auto-attached iframe network capture#163
Open
nmsbnmsb1 wants to merge 1 commit intoepiral:mainfrom
Open
feat(iframe): support auto-attached iframe network capture#163nmsbnmsb1 wants to merge 1 commit intoepiral:mainfrom
nmsbnmsb1 wants to merge 1 commit intoepiral:mainfrom
Conversation
Add iframe target ownership tracking in the daemon CDP connection so auto-attached child iframe targets are mapped back to their owning page tab. Enable Network on iframe child targets, route iframe network events into the owning page tab, and fetch response bodies from the originating target to preserve --with-body support. Update tab network state to scope requests by origin target plus requestId, add coverage for iframe target routing, and allow open --tab to accept short tab IDs in the CLI.
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.
Description
This PR enables network request monitoring for cross-origin iframes by leveraging CDP's auto-attach mechanism.
Key changes:
Target.setAutoAttachon page targets to automatically intercept child iframe targets.ownerPageTargetByTarget) to map iframe events back to their parent tab.Networkdomain on new iframe targets and routes their events to the TabStateManager.Why?
Many modern sites (like video platforms) embed players or critical content inside cross-origin iframes. Previously, bb-browser could only see main-frame requests, missing important traffic like m3u8 playlist segments or XHR calls within those iframes.
Test Result
Verified using a test case with a cross-origin iframe (
httpbin.orgembedded inexample.com). All network requests (including the iframe's initial load and sub-requests) were successfully captured in the CLI output.