@@ -23,7 +23,6 @@ import type {
2323 BrowserContext ,
2424 ConsoleMessage ,
2525 Debugger ,
26- Dialog ,
2726 ElementHandle ,
2827 HTTPRequest ,
2928 Page ,
@@ -205,7 +204,7 @@ export class McpContext implements Context {
205204 }
206205
207206 #resolveTargetPage( ) : Page {
208- return this . #requestPage?. pptrPage ?? this . getSelectedPage ( ) ;
207+ return this . #requestPage?. pptrPage ?? this . getSelectedPptrPage ( ) ;
209208 }
210209
211210 resolveCdpRequestId ( cdpRequestId : string ) : number | undefined {
@@ -327,7 +326,7 @@ export class McpContext implements Context {
327326 }
328327
329328 async restoreEmulation ( targetPage ?: Page ) {
330- const page = targetPage ?? this . getSelectedPage ( ) ;
329+ const page = targetPage ?? this . getSelectedPptrPage ( ) ;
331330 const mcpPage = this . #getMcpPage( page ) ;
332331 const currentSetting = mcpPage . emulationSettings ;
333332 await this . emulate ( currentSetting , targetPage ) ;
@@ -344,7 +343,7 @@ export class McpContext implements Context {
344343 } ,
345344 targetPage ?: Page ,
346345 ) : Promise < void > {
347- const page = targetPage ?? this . getSelectedPage ( ) ;
346+ const page = targetPage ?? this . getSelectedPptrPage ( ) ;
348347 const mcpPage = this . #getMcpPage( page ) ;
349348 const newSettings : EmulationSettings = { ...mcpPage . emulationSettings } ;
350349 let timeoutsNeedUpdate = false ;
@@ -492,23 +491,7 @@ export class McpContext implements Context {
492491 return this . #options. performanceCrux ;
493492 }
494493
495- getDialog ( page ?: Page ) : Dialog | undefined {
496- const targetPage =
497- page ?? this . #requestPage?. pptrPage ?? this . #selectedPage;
498- if ( ! targetPage ) {
499- return undefined ;
500- }
501- return this . #mcpPages. get ( targetPage ) ?. dialog ;
502- }
503-
504- clearDialog ( page ?: Page ) : void {
505- const targetPage = page ?? this . #selectedPage;
506- if ( targetPage ) {
507- this . #mcpPages. get ( targetPage ) ?. clearDialog ( ) ;
508- }
509- }
510-
511- getSelectedPage ( ) : Page {
494+ getSelectedPptrPage ( ) : Page {
512495 const page = this . #selectedPage;
513496 if ( ! page ) {
514497 throw new Error ( 'No page selected' ) ;
@@ -522,7 +505,7 @@ export class McpContext implements Context {
522505 }
523506
524507 getSelectedMcpPage ( ) : McpPage {
525- const page = this . getSelectedPage ( ) ;
508+ const page = this . getSelectedPptrPage ( ) ;
526509 return this . #getMcpPage( page ) ;
527510 }
528511
@@ -555,7 +538,7 @@ export class McpContext implements Context {
555538 }
556539
557540 #getSelectedMcpPage( ) : McpPage {
558- return this . #getMcpPage( this . getSelectedPage ( ) ) ;
541+ return this . #getMcpPage( this . getSelectedPptrPage ( ) ) ;
559542 }
560543
561544 isPageSelected ( page : Page ) : boolean {
@@ -595,7 +578,7 @@ export class McpContext implements Context {
595578 }
596579
597580 #updateSelectedPageTimeouts( ) {
598- const page = this . getSelectedPage ( ) ;
581+ const page = this . getSelectedPptrPage ( ) ;
599582 // For waiters 5sec timeout should be sufficient.
600583 // Increased in case we throttle the CPU
601584 const cpuMultiplier = this . getCpuThrottlingRate ( ) ;
@@ -922,7 +905,7 @@ export class McpContext implements Context {
922905 devtoolsData : DevToolsData | undefined = undefined ,
923906 targetPage ?: Page ,
924907 ) : Promise < void > {
925- const page = targetPage ?? this . getSelectedPage ( ) ;
908+ const page = targetPage ?? this . getSelectedPptrPage ( ) ;
926909 const mcpPage = this . #getMcpPage( page ) ;
927910 const rootNode = await page . accessibility . snapshot ( {
928911 includeIframes : true ,
@@ -1063,7 +1046,7 @@ export class McpContext implements Context {
10631046 action : ( ) => Promise < unknown > ,
10641047 options ?: { timeout ?: number } ,
10651048 ) : Promise < void > {
1066- const page = this . getSelectedPage ( ) ;
1049+ const page = this . getSelectedPptrPage ( ) ;
10671050 const cpuMultiplier = this . getCpuThrottlingRate ( ) ;
10681051 const networkMultiplier = getNetworkMultiplierFromString (
10691052 this . getNetworkConditions ( ) ,
@@ -1085,7 +1068,7 @@ export class McpContext implements Context {
10851068 timeout ?: number ,
10861069 targetPage ?: Page ,
10871070 ) : Promise < Element > {
1088- const page = targetPage ?? this . getSelectedPage ( ) ;
1071+ const page = targetPage ?? this . getSelectedPptrPage ( ) ;
10891072 const frames = page . frames ( ) ;
10901073
10911074 let locator = this . #locatorClass. race (
0 commit comments