chore(extension): exit gracefully when waiting for extension connection (#754)

This commit is contained in:
Yury Semikhatsky 2025-07-24 16:02:02 -07:00 committed by GitHub
parent e0fb748ccc
commit e153ac3b7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 16 deletions

View file

@ -17,6 +17,7 @@
import debug from 'debug';
import * as playwright from 'playwright';
import { logUnhandledError } from './log.js';
import { Tab } from './tab.js';
import type { Tool } from './tools/tool.js';
@ -140,7 +141,7 @@ export class Context {
async closeBrowserContext() {
if (!this._closeBrowserContextPromise)
this._closeBrowserContextPromise = this._closeBrowserContextImpl();
this._closeBrowserContextPromise = this._closeBrowserContextImpl().catch(logUnhandledError);
await this._closeBrowserContextPromise;
this._closeBrowserContextPromise = undefined;
}