Differentiate between Same-Origin and OOPIF iframe handling
mainThe agent handles iframes differently depending on their origin, which affects how data is captured and how sessions are managed:
Same-Origin Iframes
- Data Capture: Content is captured using
pierce: trueduringbuildBackendIdMaps. - Session: Shares the same
root-sessionas the main frame. - Resolution: Frames are matched via
backendNodeIdwithin the existing session.
OOPIF (Out-of-Process Iframes) / Cross-Origin Iframes
- Data Capture: Content cannot be captured from the main frame due to cross-origin restrictions. Instead,
captureOOPIFsis used, which callsbuildBackendIdMaps(oopifSession, pierce: false). - Session: Requires a separate CDP session created via
context.newCDPSession(). ThesessionIdwill be unique (e.g.,"oopif-session-1"). - Discovery: Discovered via Target events.