mirror of
				https://github.com/microsoft/playwright.git
				synced 2025-06-26 21:40:17 +00:00 
			
		
		
		
	chore: rename reuseController to debugController (#17520)
This commit is contained in:
		
							parent
							
								
									f17d345ac9
								
							
						
					
					
						commit
						cb10ef3c71
					
				| @ -26,7 +26,7 @@ import { IpcTransport, PipeTransport } from '../protocol/transport'; | |||||||
| import { PlaywrightServer } from '../remote/playwrightServer'; | import { PlaywrightServer } from '../remote/playwrightServer'; | ||||||
| import { gracefullyCloseAll } from '../utils/processLauncher'; | import { gracefullyCloseAll } from '../utils/processLauncher'; | ||||||
| import type { Mode } from '@recorder/recorderTypes'; | import type { Mode } from '@recorder/recorderTypes'; | ||||||
| import { ReuseController } from '../server/reuseController'; | import { DebugController } from '../server/debugController'; | ||||||
| 
 | 
 | ||||||
| export function printApiJson() { | export function printApiJson() { | ||||||
|   // Note: this file is generated by build-playwright-driver.sh
 |   // Note: this file is generated by build-playwright-driver.sh
 | ||||||
| @ -80,17 +80,17 @@ function selfDestruct() { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class ProtocolHandler { | class ProtocolHandler { | ||||||
|   private _controller: ReuseController; |   private _controller: DebugController; | ||||||
| 
 | 
 | ||||||
|   constructor(playwright: Playwright) { |   constructor(playwright: Playwright) { | ||||||
|     this._controller = playwright.reuseController; |     this._controller = playwright.debugController; | ||||||
|     this._controller.setAutoCloseAllowed(true); |     this._controller.setAutoCloseAllowed(true); | ||||||
|     this._controller.setTrackHierarcy(true); |     this._controller.setTrackHierarcy(true); | ||||||
|     this._controller.setReuseBrowser(true); |     this._controller.setReuseBrowser(true); | ||||||
|     this._controller.on(ReuseController.Events.BrowsersChanged, browsers => { |     this._controller.on(DebugController.Events.BrowsersChanged, browsers => { | ||||||
|       process.send!({ method: 'browsersChanged', params: { browsers } }); |       process.send!({ method: 'browsersChanged', params: { browsers } }); | ||||||
|     }); |     }); | ||||||
|     this._controller.on(ReuseController.Events.InspectRequested, selector => { |     this._controller.on(DebugController.Events.InspectRequested, selector => { | ||||||
|       process.send!({ method: 'inspectRequested', params: { selector } }); |       process.send!({ method: 'inspectRequested', params: { selector } }); | ||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
|  | |||||||
| @ -321,54 +321,50 @@ scheme.RecorderSource = tObject({ | |||||||
|   revealLine: tOptional(tNumber), |   revealLine: tOptional(tNumber), | ||||||
|   group: tOptional(tString), |   group: tOptional(tString), | ||||||
| }); | }); | ||||||
| scheme.ReuseControllerInitializer = tOptional(tObject({})); | scheme.DebugControllerInitializer = tOptional(tObject({})); | ||||||
| scheme.ReuseControllerInspectRequestedEvent = tObject({ | scheme.DebugControllerInspectRequestedEvent = tObject({ | ||||||
|   selector: tString, |   selector: tString, | ||||||
| }); | }); | ||||||
| scheme.ReuseControllerBrowsersChangedEvent = tObject({ | scheme.DebugControllerBrowsersChangedEvent = tObject({ | ||||||
|   browsers: tArray(tObject({ |   browsers: tArray(tObject({ | ||||||
|     contexts: tArray(tObject({ |     contexts: tArray(tObject({ | ||||||
|       pages: tArray(tString), |       pages: tArray(tString), | ||||||
|     })), |     })), | ||||||
|   })), |   })), | ||||||
| }); | }); | ||||||
| scheme.ReuseControllerSourcesChangedEvent = tObject({ | scheme.DebugControllerSourcesChangedEvent = tObject({ | ||||||
|   sources: tArray(tType('RecorderSource')), |   sources: tArray(tType('RecorderSource')), | ||||||
| }); | }); | ||||||
| scheme.ReuseControllerSetTrackHierarchyParams = tObject({ | scheme.DebugControllerSetTrackHierarchyParams = tObject({ | ||||||
|   enabled: tBoolean, |   enabled: tBoolean, | ||||||
| }); | }); | ||||||
| scheme.ReuseControllerSetTrackHierarchyResult = tOptional(tObject({})); | scheme.DebugControllerSetTrackHierarchyResult = tOptional(tObject({})); | ||||||
| scheme.ReuseControllerSetReuseBrowserParams = tObject({ | scheme.DebugControllerSetReuseBrowserParams = tObject({ | ||||||
|   enabled: tBoolean, |   enabled: tBoolean, | ||||||
| }); | }); | ||||||
| scheme.ReuseControllerSetReuseBrowserResult = tOptional(tObject({})); | scheme.DebugControllerSetReuseBrowserResult = tOptional(tObject({})); | ||||||
| scheme.ReuseControllerResetForReuseParams = tOptional(tObject({})); | scheme.DebugControllerResetForReuseParams = tOptional(tObject({})); | ||||||
| scheme.ReuseControllerResetForReuseResult = tOptional(tObject({})); | scheme.DebugControllerResetForReuseResult = tOptional(tObject({})); | ||||||
| scheme.ReuseControllerNavigateAllParams = tObject({ | scheme.DebugControllerNavigateAllParams = tObject({ | ||||||
|   url: tString, |   url: tString, | ||||||
| }); | }); | ||||||
| scheme.ReuseControllerNavigateAllResult = tOptional(tObject({})); | scheme.DebugControllerNavigateAllResult = tOptional(tObject({})); | ||||||
| scheme.ReuseControllerSetRecorderModeParams = tObject({ | scheme.DebugControllerSetRecorderModeParams = tObject({ | ||||||
|   mode: tEnum(['inspecting', 'recording', 'none']), |   mode: tEnum(['inspecting', 'recording', 'none']), | ||||||
|   language: tOptional(tString), |   language: tOptional(tString), | ||||||
|   file: tOptional(tString), |   file: tOptional(tString), | ||||||
| }); | }); | ||||||
| scheme.ReuseControllerSetRecorderModeResult = tOptional(tObject({})); | scheme.DebugControllerSetRecorderModeResult = tOptional(tObject({})); | ||||||
| scheme.ReuseControllerSetAutoCloseParams = tObject({ | scheme.DebugControllerHighlightAllParams = tObject({ | ||||||
|   enabled: tBoolean, |  | ||||||
| }); |  | ||||||
| scheme.ReuseControllerSetAutoCloseResult = tOptional(tObject({})); |  | ||||||
| scheme.ReuseControllerHighlightAllParams = tObject({ |  | ||||||
|   selector: tString, |   selector: tString, | ||||||
| }); | }); | ||||||
| scheme.ReuseControllerHighlightAllResult = tOptional(tObject({})); | scheme.DebugControllerHighlightAllResult = tOptional(tObject({})); | ||||||
| scheme.ReuseControllerHideHighlightAllParams = tOptional(tObject({})); | scheme.DebugControllerHideHighlightAllParams = tOptional(tObject({})); | ||||||
| scheme.ReuseControllerHideHighlightAllResult = tOptional(tObject({})); | scheme.DebugControllerHideHighlightAllResult = tOptional(tObject({})); | ||||||
| scheme.ReuseControllerKillParams = tOptional(tObject({})); | scheme.DebugControllerKillParams = tOptional(tObject({})); | ||||||
| scheme.ReuseControllerKillResult = tOptional(tObject({})); | scheme.DebugControllerKillResult = tOptional(tObject({})); | ||||||
| scheme.ReuseControllerCloseAllBrowsersParams = tOptional(tObject({})); | scheme.DebugControllerCloseAllBrowsersParams = tOptional(tObject({})); | ||||||
| scheme.ReuseControllerCloseAllBrowsersResult = tOptional(tObject({})); | scheme.DebugControllerCloseAllBrowsersResult = tOptional(tObject({})); | ||||||
| scheme.SocksSupportInitializer = tOptional(tObject({})); | scheme.SocksSupportInitializer = tOptional(tObject({})); | ||||||
| scheme.SocksSupportSocksRequestedEvent = tObject({ | scheme.SocksSupportSocksRequestedEvent = tObject({ | ||||||
|   uid: tString, |   uid: tString, | ||||||
|  | |||||||
| @ -24,7 +24,7 @@ import { SocksProxy } from '../common/socksProxy'; | |||||||
| import type { Mode } from './playwrightServer'; | import type { Mode } from './playwrightServer'; | ||||||
| import { assert } from '../utils'; | import { assert } from '../utils'; | ||||||
| import type { LaunchOptions } from '../server/types'; | import type { LaunchOptions } from '../server/types'; | ||||||
| import { ReuseControllerDispatcher } from '../server/dispatchers/reuseControllerDispatcher'; | import { DebugControllerDispatcher } from '../server/dispatchers/debugControllerDispatcher'; | ||||||
| 
 | 
 | ||||||
| type Options = { | type Options = { | ||||||
|   enableSocksProxy: boolean, |   enableSocksProxy: boolean, | ||||||
| @ -48,7 +48,7 @@ export class PlaywrightConnection { | |||||||
|   private _options: Options; |   private _options: Options; | ||||||
|   private _root: DispatcherScope; |   private _root: DispatcherScope; | ||||||
| 
 | 
 | ||||||
|   constructor(lock: Promise<void>, mode: Mode, ws: WebSocket, isReuseControllerClient: boolean, options: Options, preLaunched: PreLaunched, log: (m: string) => void, onClose: () => void) { |   constructor(lock: Promise<void>, mode: Mode, ws: WebSocket, isDebugControllerClient: boolean, options: Options, preLaunched: PreLaunched, log: (m: string) => void, onClose: () => void) { | ||||||
|     this._ws = ws; |     this._ws = ws; | ||||||
|     this._preLaunched = preLaunched; |     this._preLaunched = preLaunched; | ||||||
|     this._options = options; |     this._options = options; | ||||||
| @ -73,8 +73,8 @@ export class PlaywrightConnection { | |||||||
|     ws.on('close', () => this._onDisconnect()); |     ws.on('close', () => this._onDisconnect()); | ||||||
|     ws.on('error', error => this._onDisconnect(error)); |     ws.on('error', error => this._onDisconnect(error)); | ||||||
| 
 | 
 | ||||||
|     if (isReuseControllerClient) { |     if (isDebugControllerClient) { | ||||||
|       this._root = this._initReuseControllerMode(); |       this._root = this._initDebugControllerMode(); | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -136,12 +136,12 @@ export class PlaywrightConnection { | |||||||
|     return playwrightDispatcher; |     return playwrightDispatcher; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   private _initReuseControllerMode(): ReuseControllerDispatcher { |   private _initDebugControllerMode(): DebugControllerDispatcher { | ||||||
|     this._debugLog(`engaged reuse controller mode`); |     this._debugLog(`engaged reuse controller mode`); | ||||||
|     const playwright = this._preLaunched.playwright!; |     const playwright = this._preLaunched.playwright!; | ||||||
|     this._cleanups.push(() => gracefullyCloseAll()); |     this._cleanups.push(() => gracefullyCloseAll()); | ||||||
|     // Always create new instance based on the reused Playwright instance.
 |     // Always create new instance based on the reused Playwright instance.
 | ||||||
|     return new ReuseControllerDispatcher(this._dispatcherConnection, playwright.reuseController); |     return new DebugControllerDispatcher(this._dispatcherConnection, playwright.debugController); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   private async _initReuseBrowsersMode(scope: RootDispatcher) { |   private async _initReuseBrowsersMode(scope: RootDispatcher) { | ||||||
|  | |||||||
| @ -111,17 +111,17 @@ export class PlaywrightServer { | |||||||
| 
 | 
 | ||||||
|       const log = newLogger(); |       const log = newLogger(); | ||||||
|       log(`serving connection: ${request.url}`); |       log(`serving connection: ${request.url}`); | ||||||
|       const isReuseControllerClient = !!request.headers['x-playwright-reuse-controller']; |       const isDebugControllerClient = !!request.headers['x-playwright-debug-controller']; | ||||||
|       const semaphore = isReuseControllerClient ? controllerSemaphore : browserSemaphore; |       const semaphore = isDebugControllerClient ? controllerSemaphore : browserSemaphore; | ||||||
| 
 | 
 | ||||||
|       // If we started in the legacy reuse-browser mode, create this._preLaunchedPlaywright.
 |       // If we started in the legacy reuse-browser mode, create this._preLaunchedPlaywright.
 | ||||||
|       // If we get a reuse-controller request,  create this._preLaunchedPlaywright.
 |       // If we get a reuse-controller request,  create this._preLaunchedPlaywright.
 | ||||||
|       if (isReuseControllerClient || (this._mode === 'reuse-browser') && !this._preLaunchedPlaywright) |       if (isDebugControllerClient || (this._mode === 'reuse-browser') && !this._preLaunchedPlaywright) | ||||||
|         this.preLaunchedPlaywright(); |         this.preLaunchedPlaywright(); | ||||||
| 
 | 
 | ||||||
|       // If we have a playwright to reuse, consult controller for reuse mode.
 |       // If we have a playwright to reuse, consult controller for reuse mode.
 | ||||||
|       let mode = this._mode; |       let mode = this._mode; | ||||||
|       if (mode === 'auto' && this._preLaunchedPlaywright?.reuseController.reuseBrowser()) |       if (mode === 'auto' && this._preLaunchedPlaywright?.debugController.reuseBrowser()) | ||||||
|         mode = 'reuse-browser'; |         mode = 'reuse-browser'; | ||||||
| 
 | 
 | ||||||
|       if (mode === 'reuse-browser') |       if (mode === 'reuse-browser') | ||||||
| @ -131,7 +131,7 @@ export class PlaywrightServer { | |||||||
| 
 | 
 | ||||||
|       const connection = new PlaywrightConnection( |       const connection = new PlaywrightConnection( | ||||||
|           semaphore.aquire(), |           semaphore.aquire(), | ||||||
|           mode, ws, isReuseControllerClient, |           mode, ws, isDebugControllerClient, | ||||||
|           { enableSocksProxy, browserName, launchOptions }, |           { enableSocksProxy, browserName, launchOptions }, | ||||||
|           { playwright: this._preLaunchedPlaywright, browser: this._options.preLaunchedBrowser || null }, |           { playwright: this._preLaunchedPlaywright, browser: this._options.preLaunchedBrowser || null }, | ||||||
|           log, () => semaphore.release()); |           log, () => semaphore.release()); | ||||||
|  | |||||||
| @ -26,7 +26,7 @@ import { EmptyRecorderApp } from './recorder/recorderApp'; | |||||||
| 
 | 
 | ||||||
| const internalMetadata = serverSideCallMetadata(); | const internalMetadata = serverSideCallMetadata(); | ||||||
| 
 | 
 | ||||||
| export class ReuseController extends SdkObject { | export class DebugController extends SdkObject { | ||||||
|   static Events = { |   static Events = { | ||||||
|     BrowsersChanged: 'browsersChanged', |     BrowsersChanged: 'browsersChanged', | ||||||
|     InspectRequested: 'inspectRequested', |     InspectRequested: 'inspectRequested', | ||||||
| @ -41,7 +41,7 @@ export class ReuseController extends SdkObject { | |||||||
|   private _reuseBrowser = false; |   private _reuseBrowser = false; | ||||||
| 
 | 
 | ||||||
|   constructor(playwright: Playwright) { |   constructor(playwright: Playwright) { | ||||||
|     super({ attribution: { isInternalPlaywright: true }, instrumentation: createInstrumentation() } as any, undefined, 'ReuseController'); |     super({ attribution: { isInternalPlaywright: true }, instrumentation: createInstrumentation() } as any, undefined, 'DebugController'); | ||||||
|     this._playwright = playwright; |     this._playwright = playwright; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| @ -174,7 +174,7 @@ export class ReuseController extends SdkObject { | |||||||
|           c.pages.push(page.mainFrame().url()); |           c.pages.push(page.mainFrame().url()); | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|     this.emit(ReuseController.Events.BrowsersChanged, browsers); |     this.emit(DebugController.Events.BrowsersChanged, browsers); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   private async _allRecorders(): Promise<Recorder[]> { |   private async _allRecorders(): Promise<Recorder[]> { | ||||||
| @ -207,18 +207,18 @@ function selfDestruct() { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class InspectingRecorderApp extends EmptyRecorderApp { | class InspectingRecorderApp extends EmptyRecorderApp { | ||||||
|   private _reuseController: ReuseController; |   private _debugController: DebugController; | ||||||
| 
 | 
 | ||||||
|   constructor(reuseController: ReuseController) { |   constructor(debugController: DebugController) { | ||||||
|     super(); |     super(); | ||||||
|     this._reuseController = reuseController; |     this._debugController = debugController; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   override async setSelector(selector: string): Promise<void> { |   override async setSelector(selector: string): Promise<void> { | ||||||
|     this._reuseController.emit(ReuseController.Events.InspectRequested, selector); |     this._debugController.emit(DebugController.Events.InspectRequested, selector); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   override async setSources(sources: Source[]): Promise<void> { |   override async setSources(sources: Source[]): Promise<void> { | ||||||
|     this._reuseController.emit(ReuseController.Events.SourcesChanged, sources); |     this._debugController.emit(DebugController.Events.SourcesChanged, sources); | ||||||
|   } |   } | ||||||
| } | } | ||||||
| @ -15,32 +15,32 @@ | |||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| import type * as channels from '@protocol/channels'; | import type * as channels from '@protocol/channels'; | ||||||
| import { ReuseController } from '../reuseController'; | import { DebugController } from '../debugController'; | ||||||
| import type { DispatcherConnection, RootDispatcher } from './dispatcher'; | import type { DispatcherConnection, RootDispatcher } from './dispatcher'; | ||||||
| import { Dispatcher } from './dispatcher'; | import { Dispatcher } from './dispatcher'; | ||||||
| 
 | 
 | ||||||
| export class ReuseControllerDispatcher extends Dispatcher<ReuseController, channels.ReuseControllerChannel, RootDispatcher> implements channels.ReuseControllerChannel { | export class DebugControllerDispatcher extends Dispatcher<DebugController, channels.DebugControllerChannel, RootDispatcher> implements channels.DebugControllerChannel { | ||||||
|   _type_ReuseController; |   _type_DebugController; | ||||||
| 
 | 
 | ||||||
|   constructor(connection: DispatcherConnection, reuseController: ReuseController) { |   constructor(connection: DispatcherConnection, debugController: DebugController) { | ||||||
|     super(connection, reuseController, 'ReuseController', {}); |     super(connection, debugController, 'DebugController', {}); | ||||||
|     this._type_ReuseController = true; |     this._type_DebugController = true; | ||||||
|     this._object.on(ReuseController.Events.BrowsersChanged, browsers => { |     this._object.on(DebugController.Events.BrowsersChanged, browsers => { | ||||||
|       this._dispatchEvent('browsersChanged', { browsers }); |       this._dispatchEvent('browsersChanged', { browsers }); | ||||||
|     }); |     }); | ||||||
|     this._object.on(ReuseController.Events.InspectRequested, selector => { |     this._object.on(DebugController.Events.InspectRequested, selector => { | ||||||
|       this._dispatchEvent('inspectRequested', { selector }); |       this._dispatchEvent('inspectRequested', { selector }); | ||||||
|     }); |     }); | ||||||
|     this._object.on(ReuseController.Events.SourcesChanged, sources => { |     this._object.on(DebugController.Events.SourcesChanged, sources => { | ||||||
|       this._dispatchEvent('sourcesChanged', { sources }); |       this._dispatchEvent('sourcesChanged', { sources }); | ||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   async setTrackHierarchy(params: channels.ReuseControllerSetTrackHierarchyParams) { |   async setTrackHierarchy(params: channels.DebugControllerSetTrackHierarchyParams) { | ||||||
|     this._object.setTrackHierarcy(params.enabled); |     this._object.setTrackHierarcy(params.enabled); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   async setReuseBrowser(params: channels.ReuseControllerSetReuseBrowserParams) { |   async setReuseBrowser(params: channels.DebugControllerSetReuseBrowserParams) { | ||||||
|     this._object.setReuseBrowser(params.enabled); |     this._object.setReuseBrowser(params.enabled); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| @ -48,19 +48,15 @@ export class ReuseControllerDispatcher extends Dispatcher<ReuseController, chann | |||||||
|     await this._object.resetForReuse(); |     await this._object.resetForReuse(); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   async navigateAll(params: channels.ReuseControllerNavigateAllParams) { |   async navigateAll(params: channels.DebugControllerNavigateAllParams) { | ||||||
|     await this._object.navigateAll(params.url); |     await this._object.navigateAll(params.url); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   async setRecorderMode(params: channels.ReuseControllerSetRecorderModeParams) { |   async setRecorderMode(params: channels.DebugControllerSetRecorderModeParams) { | ||||||
|     await this._object.setRecorderMode(params); |     await this._object.setRecorderMode(params); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   async setAutoClose(params: channels.ReuseControllerSetAutoCloseParams) { |   async highlightAll(params: channels.DebugControllerHighlightAllParams) { | ||||||
|     await this._object.setAutoCloseEnabled(params.enabled); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   async highlightAll(params: channels.ReuseControllerHighlightAllParams) { |  | ||||||
|     await this._object.highlightAll(params.selector); |     await this._object.highlightAll(params.selector); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| @ -26,7 +26,7 @@ import type { CallMetadata } from './instrumentation'; | |||||||
| import { createInstrumentation, SdkObject } from './instrumentation'; | import { createInstrumentation, SdkObject } from './instrumentation'; | ||||||
| import { debugLogger } from '../common/debugLogger'; | import { debugLogger } from '../common/debugLogger'; | ||||||
| import type { Page } from './page'; | import type { Page } from './page'; | ||||||
| import { ReuseController } from './reuseController'; | import { DebugController } from './debugController'; | ||||||
| 
 | 
 | ||||||
| export class Playwright extends SdkObject { | export class Playwright extends SdkObject { | ||||||
|   readonly selectors: Selectors; |   readonly selectors: Selectors; | ||||||
| @ -36,7 +36,7 @@ export class Playwright extends SdkObject { | |||||||
|   readonly firefox: Firefox; |   readonly firefox: Firefox; | ||||||
|   readonly webkit: WebKit; |   readonly webkit: WebKit; | ||||||
|   readonly options: PlaywrightOptions; |   readonly options: PlaywrightOptions; | ||||||
|   readonly reuseController: ReuseController; |   readonly debugController: DebugController; | ||||||
|   private _allPages = new Set<Page>(); |   private _allPages = new Set<Page>(); | ||||||
|   private _allBrowsers = new Set<Browser>(); |   private _allBrowsers = new Set<Browser>(); | ||||||
| 
 | 
 | ||||||
| @ -62,7 +62,7 @@ export class Playwright extends SdkObject { | |||||||
|     this.electron = new Electron(this.options); |     this.electron = new Electron(this.options); | ||||||
|     this.android = new Android(new AdbBackend(), this.options); |     this.android = new Android(new AdbBackend(), this.options); | ||||||
|     this.selectors = this.options.selectors; |     this.selectors = this.options.selectors; | ||||||
|     this.reuseController = new ReuseController(this); |     this.debugController = new DebugController(this); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   async hideHighlight() { |   async hideHighlight() { | ||||||
|  | |||||||
| @ -52,7 +52,7 @@ export type InitializerTraits<T> = | |||||||
|     T extends BrowserTypeChannel ? BrowserTypeInitializer : |     T extends BrowserTypeChannel ? BrowserTypeInitializer : | ||||||
|     T extends SelectorsChannel ? SelectorsInitializer : |     T extends SelectorsChannel ? SelectorsInitializer : | ||||||
|     T extends SocksSupportChannel ? SocksSupportInitializer : |     T extends SocksSupportChannel ? SocksSupportInitializer : | ||||||
|     T extends ReuseControllerChannel ? ReuseControllerInitializer : |     T extends DebugControllerChannel ? DebugControllerInitializer : | ||||||
|     T extends PlaywrightChannel ? PlaywrightInitializer : |     T extends PlaywrightChannel ? PlaywrightInitializer : | ||||||
|     T extends RootChannel ? RootInitializer : |     T extends RootChannel ? RootInitializer : | ||||||
|     T extends LocalUtilsChannel ? LocalUtilsInitializer : |     T extends LocalUtilsChannel ? LocalUtilsInitializer : | ||||||
| @ -90,7 +90,7 @@ export type EventsTraits<T> = | |||||||
|     T extends BrowserTypeChannel ? BrowserTypeEvents : |     T extends BrowserTypeChannel ? BrowserTypeEvents : | ||||||
|     T extends SelectorsChannel ? SelectorsEvents : |     T extends SelectorsChannel ? SelectorsEvents : | ||||||
|     T extends SocksSupportChannel ? SocksSupportEvents : |     T extends SocksSupportChannel ? SocksSupportEvents : | ||||||
|     T extends ReuseControllerChannel ? ReuseControllerEvents : |     T extends DebugControllerChannel ? DebugControllerEvents : | ||||||
|     T extends PlaywrightChannel ? PlaywrightEvents : |     T extends PlaywrightChannel ? PlaywrightEvents : | ||||||
|     T extends RootChannel ? RootEvents : |     T extends RootChannel ? RootEvents : | ||||||
|     T extends LocalUtilsChannel ? LocalUtilsEvents : |     T extends LocalUtilsChannel ? LocalUtilsEvents : | ||||||
| @ -128,7 +128,7 @@ export type EventTargetTraits<T> = | |||||||
|     T extends BrowserTypeChannel ? BrowserTypeEventTarget : |     T extends BrowserTypeChannel ? BrowserTypeEventTarget : | ||||||
|     T extends SelectorsChannel ? SelectorsEventTarget : |     T extends SelectorsChannel ? SelectorsEventTarget : | ||||||
|     T extends SocksSupportChannel ? SocksSupportEventTarget : |     T extends SocksSupportChannel ? SocksSupportEventTarget : | ||||||
|     T extends ReuseControllerChannel ? ReuseControllerEventTarget : |     T extends DebugControllerChannel ? DebugControllerEventTarget : | ||||||
|     T extends PlaywrightChannel ? PlaywrightEventTarget : |     T extends PlaywrightChannel ? PlaywrightEventTarget : | ||||||
|     T extends RootChannel ? RootEventTarget : |     T extends RootChannel ? RootEventTarget : | ||||||
|     T extends LocalUtilsChannel ? LocalUtilsEventTarget : |     T extends LocalUtilsChannel ? LocalUtilsEventTarget : | ||||||
| @ -572,101 +572,93 @@ export type RecorderSource = { | |||||||
|   group?: string, |   group?: string, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| // ----------- ReuseController -----------
 | // ----------- DebugController -----------
 | ||||||
| export type ReuseControllerInitializer = {}; | export type DebugControllerInitializer = {}; | ||||||
| export interface ReuseControllerEventTarget { | export interface DebugControllerEventTarget { | ||||||
|   on(event: 'inspectRequested', callback: (params: ReuseControllerInspectRequestedEvent) => void): this; |   on(event: 'inspectRequested', callback: (params: DebugControllerInspectRequestedEvent) => void): this; | ||||||
|   on(event: 'browsersChanged', callback: (params: ReuseControllerBrowsersChangedEvent) => void): this; |   on(event: 'browsersChanged', callback: (params: DebugControllerBrowsersChangedEvent) => void): this; | ||||||
|   on(event: 'sourcesChanged', callback: (params: ReuseControllerSourcesChangedEvent) => void): this; |   on(event: 'sourcesChanged', callback: (params: DebugControllerSourcesChangedEvent) => void): this; | ||||||
| } | } | ||||||
| export interface ReuseControllerChannel extends ReuseControllerEventTarget, Channel { | export interface DebugControllerChannel extends DebugControllerEventTarget, Channel { | ||||||
|   _type_ReuseController: boolean; |   _type_DebugController: boolean; | ||||||
|   setTrackHierarchy(params: ReuseControllerSetTrackHierarchyParams, metadata?: Metadata): Promise<ReuseControllerSetTrackHierarchyResult>; |   setTrackHierarchy(params: DebugControllerSetTrackHierarchyParams, metadata?: Metadata): Promise<DebugControllerSetTrackHierarchyResult>; | ||||||
|   setReuseBrowser(params: ReuseControllerSetReuseBrowserParams, metadata?: Metadata): Promise<ReuseControllerSetReuseBrowserResult>; |   setReuseBrowser(params: DebugControllerSetReuseBrowserParams, metadata?: Metadata): Promise<DebugControllerSetReuseBrowserResult>; | ||||||
|   resetForReuse(params?: ReuseControllerResetForReuseParams, metadata?: Metadata): Promise<ReuseControllerResetForReuseResult>; |   resetForReuse(params?: DebugControllerResetForReuseParams, metadata?: Metadata): Promise<DebugControllerResetForReuseResult>; | ||||||
|   navigateAll(params: ReuseControllerNavigateAllParams, metadata?: Metadata): Promise<ReuseControllerNavigateAllResult>; |   navigateAll(params: DebugControllerNavigateAllParams, metadata?: Metadata): Promise<DebugControllerNavigateAllResult>; | ||||||
|   setRecorderMode(params: ReuseControllerSetRecorderModeParams, metadata?: Metadata): Promise<ReuseControllerSetRecorderModeResult>; |   setRecorderMode(params: DebugControllerSetRecorderModeParams, metadata?: Metadata): Promise<DebugControllerSetRecorderModeResult>; | ||||||
|   setAutoClose(params: ReuseControllerSetAutoCloseParams, metadata?: Metadata): Promise<ReuseControllerSetAutoCloseResult>; |   highlightAll(params: DebugControllerHighlightAllParams, metadata?: Metadata): Promise<DebugControllerHighlightAllResult>; | ||||||
|   highlightAll(params: ReuseControllerHighlightAllParams, metadata?: Metadata): Promise<ReuseControllerHighlightAllResult>; |   hideHighlightAll(params?: DebugControllerHideHighlightAllParams, metadata?: Metadata): Promise<DebugControllerHideHighlightAllResult>; | ||||||
|   hideHighlightAll(params?: ReuseControllerHideHighlightAllParams, metadata?: Metadata): Promise<ReuseControllerHideHighlightAllResult>; |   kill(params?: DebugControllerKillParams, metadata?: Metadata): Promise<DebugControllerKillResult>; | ||||||
|   kill(params?: ReuseControllerKillParams, metadata?: Metadata): Promise<ReuseControllerKillResult>; |   closeAllBrowsers(params?: DebugControllerCloseAllBrowsersParams, metadata?: Metadata): Promise<DebugControllerCloseAllBrowsersResult>; | ||||||
|   closeAllBrowsers(params?: ReuseControllerCloseAllBrowsersParams, metadata?: Metadata): Promise<ReuseControllerCloseAllBrowsersResult>; |  | ||||||
| } | } | ||||||
| export type ReuseControllerInspectRequestedEvent = { | export type DebugControllerInspectRequestedEvent = { | ||||||
|   selector: string, |   selector: string, | ||||||
| }; | }; | ||||||
| export type ReuseControllerBrowsersChangedEvent = { | export type DebugControllerBrowsersChangedEvent = { | ||||||
|   browsers: { |   browsers: { | ||||||
|     contexts: { |     contexts: { | ||||||
|       pages: string[], |       pages: string[], | ||||||
|     }[], |     }[], | ||||||
|   }[], |   }[], | ||||||
| }; | }; | ||||||
| export type ReuseControllerSourcesChangedEvent = { | export type DebugControllerSourcesChangedEvent = { | ||||||
|   sources: RecorderSource[], |   sources: RecorderSource[], | ||||||
| }; | }; | ||||||
| export type ReuseControllerSetTrackHierarchyParams = { | export type DebugControllerSetTrackHierarchyParams = { | ||||||
|   enabled: boolean, |   enabled: boolean, | ||||||
| }; | }; | ||||||
| export type ReuseControllerSetTrackHierarchyOptions = { | export type DebugControllerSetTrackHierarchyOptions = { | ||||||
| 
 | 
 | ||||||
| }; | }; | ||||||
| export type ReuseControllerSetTrackHierarchyResult = void; | export type DebugControllerSetTrackHierarchyResult = void; | ||||||
| export type ReuseControllerSetReuseBrowserParams = { | export type DebugControllerSetReuseBrowserParams = { | ||||||
|   enabled: boolean, |   enabled: boolean, | ||||||
| }; | }; | ||||||
| export type ReuseControllerSetReuseBrowserOptions = { | export type DebugControllerSetReuseBrowserOptions = { | ||||||
| 
 | 
 | ||||||
| }; | }; | ||||||
| export type ReuseControllerSetReuseBrowserResult = void; | export type DebugControllerSetReuseBrowserResult = void; | ||||||
| export type ReuseControllerResetForReuseParams = {}; | export type DebugControllerResetForReuseParams = {}; | ||||||
| export type ReuseControllerResetForReuseOptions = {}; | export type DebugControllerResetForReuseOptions = {}; | ||||||
| export type ReuseControllerResetForReuseResult = void; | export type DebugControllerResetForReuseResult = void; | ||||||
| export type ReuseControllerNavigateAllParams = { | export type DebugControllerNavigateAllParams = { | ||||||
|   url: string, |   url: string, | ||||||
| }; | }; | ||||||
| export type ReuseControllerNavigateAllOptions = { | export type DebugControllerNavigateAllOptions = { | ||||||
| 
 | 
 | ||||||
| }; | }; | ||||||
| export type ReuseControllerNavigateAllResult = void; | export type DebugControllerNavigateAllResult = void; | ||||||
| export type ReuseControllerSetRecorderModeParams = { | export type DebugControllerSetRecorderModeParams = { | ||||||
|   mode: 'inspecting' | 'recording' | 'none', |   mode: 'inspecting' | 'recording' | 'none', | ||||||
|   language?: string, |   language?: string, | ||||||
|   file?: string, |   file?: string, | ||||||
| }; | }; | ||||||
| export type ReuseControllerSetRecorderModeOptions = { | export type DebugControllerSetRecorderModeOptions = { | ||||||
|   language?: string, |   language?: string, | ||||||
|   file?: string, |   file?: string, | ||||||
| }; | }; | ||||||
| export type ReuseControllerSetRecorderModeResult = void; | export type DebugControllerSetRecorderModeResult = void; | ||||||
| export type ReuseControllerSetAutoCloseParams = { | export type DebugControllerHighlightAllParams = { | ||||||
|   enabled: boolean, |  | ||||||
| }; |  | ||||||
| export type ReuseControllerSetAutoCloseOptions = { |  | ||||||
| 
 |  | ||||||
| }; |  | ||||||
| export type ReuseControllerSetAutoCloseResult = void; |  | ||||||
| export type ReuseControllerHighlightAllParams = { |  | ||||||
|   selector: string, |   selector: string, | ||||||
| }; | }; | ||||||
| export type ReuseControllerHighlightAllOptions = { | export type DebugControllerHighlightAllOptions = { | ||||||
| 
 | 
 | ||||||
| }; | }; | ||||||
| export type ReuseControllerHighlightAllResult = void; | export type DebugControllerHighlightAllResult = void; | ||||||
| export type ReuseControllerHideHighlightAllParams = {}; | export type DebugControllerHideHighlightAllParams = {}; | ||||||
| export type ReuseControllerHideHighlightAllOptions = {}; | export type DebugControllerHideHighlightAllOptions = {}; | ||||||
| export type ReuseControllerHideHighlightAllResult = void; | export type DebugControllerHideHighlightAllResult = void; | ||||||
| export type ReuseControllerKillParams = {}; | export type DebugControllerKillParams = {}; | ||||||
| export type ReuseControllerKillOptions = {}; | export type DebugControllerKillOptions = {}; | ||||||
| export type ReuseControllerKillResult = void; | export type DebugControllerKillResult = void; | ||||||
| export type ReuseControllerCloseAllBrowsersParams = {}; | export type DebugControllerCloseAllBrowsersParams = {}; | ||||||
| export type ReuseControllerCloseAllBrowsersOptions = {}; | export type DebugControllerCloseAllBrowsersOptions = {}; | ||||||
| export type ReuseControllerCloseAllBrowsersResult = void; | export type DebugControllerCloseAllBrowsersResult = void; | ||||||
| 
 | 
 | ||||||
| export interface ReuseControllerEvents { | export interface DebugControllerEvents { | ||||||
|   'inspectRequested': ReuseControllerInspectRequestedEvent; |   'inspectRequested': DebugControllerInspectRequestedEvent; | ||||||
|   'browsersChanged': ReuseControllerBrowsersChangedEvent; |   'browsersChanged': DebugControllerBrowsersChangedEvent; | ||||||
|   'sourcesChanged': ReuseControllerSourcesChangedEvent; |   'sourcesChanged': DebugControllerSourcesChangedEvent; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // ----------- SocksSupport -----------
 | // ----------- SocksSupport -----------
 | ||||||
|  | |||||||
| @ -640,7 +640,7 @@ RecorderSource: | |||||||
|     revealLine: number? |     revealLine: number? | ||||||
|     group: string? |     group: string? | ||||||
| 
 | 
 | ||||||
| ReuseController: | DebugController: | ||||||
|   type: interface |   type: interface | ||||||
| 
 | 
 | ||||||
|   commands: |   commands: | ||||||
| @ -669,10 +669,6 @@ ReuseController: | |||||||
|         language: string? |         language: string? | ||||||
|         file: string? |         file: string? | ||||||
| 
 | 
 | ||||||
|     setAutoClose: |  | ||||||
|       parameters: |  | ||||||
|         enabled: boolean |  | ||||||
| 
 |  | ||||||
|     highlightAll: |     highlightAll: | ||||||
|       parameters: |       parameters: | ||||||
|         selector: string |         selector: string | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Pavel Feldman
						Pavel Feldman