/** * Nested window / browsing-context crawler — discovers and records frames, * embedded apps, and popup windows that are already open in the browser * context at the time of a crawl step. * * Complements multi-context-handler.ts: that module handles proactive popup * interception via context.on('page'); this module snapshots what is already * present in the frame tree and context page list. */ import type { BrowserContext } from 'playwright'; export type BrowsingContextType = 'page' | 'frame' | 'popup' | 'embedded-app'; export interface BrowsingContextNode { id: string; type: BrowsingContextType; url: string; parentId: string | null; depth: number; title: string; interactiveCount: number; accessible: boolean; isEmbeddedApp: boolean; } export interface NestedCrawlResult { contextTree: BrowsingContextNode[]; totalContextsFound: number; maxDepthReached: number; inaccessibleCount: number; frameUrls: string[]; embeddedAppUrls: string[]; } /** * Discovers all nested browsing contexts reachable from the current page: * sub-frames, embedded applications, and already-open popup pages. * * All failures are non-fatal — errors are caught and an empty result is * returned so the caller's crawl step can continue uninterrupted. */ export declare function crawlNestedContexts(page: any, context: BrowserContext | null, seedUrl: string, opts?: { maxFrameDepth?: number; maxPopupDepth?: number; }): Promise;