revert other changes

This commit is contained in:
Simon Knott 2025-06-19 11:36:37 +02:00
parent 91b697cfd2
commit 3eebbd1cd1
No known key found for this signature in database
GPG Key ID: 8CEDC00028084AEC
2 changed files with 2 additions and 10 deletions

View File

@ -60,7 +60,7 @@ export class PlaywrightConnection {
private _root: DispatcherScope;
private _profileName: string;
constructor(lock: Promise<void>, clientType: ClientType, ws: WebSocket, options: Options, playwright: Playwright, preLaunched: PreLaunched, id: string, onClose: () => Promise<void>) {
constructor(lock: Promise<void>, clientType: ClientType, ws: WebSocket, options: Options, playwright: Playwright, preLaunched: PreLaunched, id: string, onClose: () => void) {
this._ws = ws;
this._playwright = playwright;
this._preLaunched = preLaunched;

View File

@ -125,15 +125,7 @@ export class PlaywrightServer {
androidDevice: this._options.preLaunchedAndroidDevice,
socksProxy: this._options.preLaunchedSocksProxy,
},
id,
async () => {
semaphore.release();
// in non-extension mode, we expect a single connection at a time. when it closes, we clean up everything.
if (this._options.mode !== 'extension')
await Promise.all(this._playwright.allBrowsers().map(browser => browser.close({ reason: 'Connection closed' })));
}
);
id, () => semaphore.release());
},
});
}