mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 21:53:35 +03:00
feat(docker): closeAllBrowsers
command for reuseController (#17383)
This commit is contained in:
parent
e92bdce383
commit
7019cc8b97
@ -119,6 +119,10 @@ class ProtocolHandler {
|
||||
await this._controller.hideHighlightAll();
|
||||
}
|
||||
|
||||
async closeAllBrowsers() {
|
||||
await this._controller.closeAllBrowsers();
|
||||
}
|
||||
|
||||
async kill() {
|
||||
await this._controller.kill();
|
||||
}
|
||||
|
@ -575,6 +575,7 @@ export interface ReuseControllerChannel extends ReuseControllerEventTarget, Chan
|
||||
highlightAll(params: ReuseControllerHighlightAllParams, metadata?: Metadata): Promise<ReuseControllerHighlightAllResult>;
|
||||
hideHighlightAll(params?: ReuseControllerHideHighlightAllParams, metadata?: Metadata): Promise<ReuseControllerHideHighlightAllResult>;
|
||||
kill(params?: ReuseControllerKillParams, metadata?: Metadata): Promise<ReuseControllerKillResult>;
|
||||
closeAllBrowsers(params?: ReuseControllerCloseAllBrowsersParams, metadata?: Metadata): Promise<ReuseControllerCloseAllBrowsersResult>;
|
||||
}
|
||||
export type ReuseControllerInspectRequestedEvent = {
|
||||
selector: string,
|
||||
@ -640,6 +641,9 @@ export type ReuseControllerHideHighlightAllResult = void;
|
||||
export type ReuseControllerKillParams = {};
|
||||
export type ReuseControllerKillOptions = {};
|
||||
export type ReuseControllerKillResult = void;
|
||||
export type ReuseControllerCloseAllBrowsersParams = {};
|
||||
export type ReuseControllerCloseAllBrowsersOptions = {};
|
||||
export type ReuseControllerCloseAllBrowsersResult = void;
|
||||
|
||||
export interface ReuseControllerEvents {
|
||||
'inspectRequested': ReuseControllerInspectRequestedEvent;
|
||||
|
@ -663,6 +663,8 @@ ReuseController:
|
||||
|
||||
kill:
|
||||
|
||||
closeAllBrowsers:
|
||||
|
||||
events:
|
||||
inspectRequested:
|
||||
parameters:
|
||||
|
@ -351,6 +351,8 @@ scheme.ReuseControllerHideHighlightAllParams = tOptional(tObject({}));
|
||||
scheme.ReuseControllerHideHighlightAllResult = tOptional(tObject({}));
|
||||
scheme.ReuseControllerKillParams = tOptional(tObject({}));
|
||||
scheme.ReuseControllerKillResult = tOptional(tObject({}));
|
||||
scheme.ReuseControllerCloseAllBrowsersParams = tOptional(tObject({}));
|
||||
scheme.ReuseControllerCloseAllBrowsersResult = tOptional(tObject({}));
|
||||
scheme.SocksSupportInitializer = tOptional(tObject({}));
|
||||
scheme.SocksSupportSocksRequestedEvent = tObject({
|
||||
uid: tString,
|
||||
|
@ -69,6 +69,10 @@ export class ReuseControllerDispatcher extends Dispatcher<ReuseController, chann
|
||||
await this._object.kill();
|
||||
}
|
||||
|
||||
async closeAllBrowsers() {
|
||||
await this._object.closeAllBrowsers();
|
||||
}
|
||||
|
||||
override _dispose() {
|
||||
super._dispose();
|
||||
this._object.dispose();
|
||||
|
@ -153,6 +153,10 @@ export class ReuseController extends SdkObject {
|
||||
selfDestruct();
|
||||
}
|
||||
|
||||
async closeAllBrowsers() {
|
||||
await Promise.all(this.allBrowsers().map(browser => browser.close()));
|
||||
}
|
||||
|
||||
private _emitSnapshot() {
|
||||
const browsers = [];
|
||||
for (const browser of this._playwright.allBrowsers()) {
|
||||
|
Loading…
Reference in New Issue
Block a user