chore(extension): bind relay lifetime to browser context (#804)

This commit is contained in:
Yury Semikhatsky
2025-07-31 22:25:40 -07:00
committed by GitHub
parent 3787439fc1
commit 7c07cc86eb
7 changed files with 101 additions and 83 deletions

View File

@@ -35,8 +35,10 @@ export function contextFactory(browserConfig: FullConfig['browser']): BrowserCon
return new PersistentContextFactory(browserConfig);
}
export type ClientInfo = { name: string, version: string };
export interface BrowserContextFactory {
createContext(clientInfo: { name: string, version: string }): Promise<{ browserContext: playwright.BrowserContext, close: () => Promise<void> }>;
createContext(clientInfo: ClientInfo, abortSignal: AbortSignal): Promise<{ browserContext: playwright.BrowserContext, close: () => Promise<void> }>;
}
class BaseContextFactory implements BrowserContextFactory {