chore: allow right click (#687)
Fixes https://github.com/microsoft/playwright-mcp/issues/467
This commit is contained in:
parent
fe0c0ffffe
commit
c97bc6e2ae
7 changed files with 156 additions and 82 deletions
|
|
@ -19,12 +19,11 @@ import net from 'node:net';
|
|||
import path from 'node:path';
|
||||
import os from 'node:os';
|
||||
|
||||
import debug from 'debug';
|
||||
import * as playwright from 'playwright';
|
||||
|
||||
import type { FullConfig } from './config.js';
|
||||
import { logUnhandledError, testDebug } from './log.js';
|
||||
|
||||
const testDebug = debug('pw:mcp:test');
|
||||
import type { FullConfig } from './config.js';
|
||||
|
||||
export function contextFactory(browserConfig: FullConfig['browser']): BrowserContextFactory {
|
||||
if (browserConfig.remoteEndpoint)
|
||||
|
|
@ -84,10 +83,10 @@ class BaseContextFactory implements BrowserContextFactory {
|
|||
testDebug(`close browser context (${this.name})`);
|
||||
if (browser.contexts().length === 1)
|
||||
this._browserPromise = undefined;
|
||||
await browserContext.close().catch(() => {});
|
||||
await browserContext.close().catch(logUnhandledError);
|
||||
if (browser.contexts().length === 0) {
|
||||
testDebug(`close browser (${this.name})`);
|
||||
await browser.close().catch(() => {});
|
||||
await browser.close().catch(logUnhandledError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue