Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions packages/playwright-core/src/tools/backend/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export type ContextConfig = {
outputMaxSize?: number;
outputMode?: 'file' | 'stdout';
saveSession?: boolean;
saveTrace?: boolean;
secrets?: Record<string, string>;
snapshot?: {
mode?: 'full' | 'none';
Expand Down Expand Up @@ -327,19 +326,6 @@ export class Context {
const browserContext = this._rawBrowserContext;
await this._setupRequestInterception(browserContext);

if (this.config.saveTrace) {
await browserContext.tracing.start({
name: 'trace-' + Date.now(),
screenshots: true,
snapshots: true,
live: true,
});
this._disposables.push({
dispose: async () => {
await browserContext.tracing.stop();
},
});
}
for (const initScript of this.config.browser?.initScript || [])
this._disposables.push(await browserContext.addInitScript({ path: path.resolve(this.options.cwd, initScript) }));

Expand Down
1 change: 0 additions & 1 deletion packages/playwright-core/src/tools/mcp/configIni.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ const longhandTypes: Record<string, LonghandType> = {
'extension': 'boolean',
'capabilities': 'string[]',
'saveSession': 'boolean',
'saveTrace': 'boolean',
'saveVideo': 'size',
'sharedBrowserContext': 'boolean',
'outputDir': 'string',
Expand Down
4 changes: 2 additions & 2 deletions tests/mcp/config.ini.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ test('ini config boolean values', async ({ startClient }) => {
const { client } = await startClient({
config: `
capabilities = config
saveTrace = true
saveSession = true
browser.contextOptions.bypassCSP = true
browser.contextOptions.javaScriptEnabled = false
`,
});

const result = await client.callTool({ name: 'browser_get_config' });
const config = JSON.parse(parseResponse(result).result);
expect(config.saveTrace).toBe(true);
expect(config.saveSession).toBe(true);
expect(config.browser.contextOptions.bypassCSP).toBe(true);
expect(config.browser.contextOptions.javaScriptEnabled).toBe(false);
});
Loading