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
4 changes: 2 additions & 2 deletions docs/src/api/class-browsertype.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ Maximum time in milliseconds to wait for the connection to be established. Defau
- `noDefaults` <[boolean]>

When true, Playwright will not apply its default overrides to the existing default browser context.
Specifically, [`option: Browser.newContext.acceptDownloads`] is left at the browser's setting, focus
emulation is not enabled, and media emulation options (such as [`option: Browser.newContext.colorScheme`],
Specifically, [`option: Browser.newContext.acceptDownloads`] and font families are left at the browser's
settings, focus emulation is not enabled, and media emulation options (such as [`option: Browser.newContext.colorScheme`],
[`option: Browser.newContext.reducedMotion`], [`option: Browser.newContext.forcedColors`], and
[`option: Browser.newContext.contrast`]) are not applied. Useful when attaching to a user's daily-driver
browser where these overrides would interfere with existing browser state. New contexts created via
Expand Down
6 changes: 3 additions & 3 deletions packages/playwright-client/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26048,9 +26048,9 @@ export interface ConnectOverCDPOptions {

/**
* When true, Playwright will not apply its default overrides to the existing default browser context. Specifically,
* [`acceptDownloads`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-accept-downloads) is
* left at the browser's setting, focus emulation is not enabled, and media emulation options (such as
* [`colorScheme`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-color-scheme),
* [`acceptDownloads`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-accept-downloads) and
* font families are left at the browser's settings, focus emulation is not enabled, and media emulation options (such
* as [`colorScheme`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-color-scheme),
* [`reducedMotion`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-reduced-motion),
* [`forcedColors`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-forced-colors), and
* [`contrast`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-contrast)) are not applied.
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/server/chromium/crPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ class FrameSession {
promises.push(emulateLocale(this._client, options.locale));
if (options.timezoneId)
promises.push(emulateTimezone(this._client, options.timezoneId));
if (!browserOptions.headful)
if (!browserOptions.headful && !skipDefaultOverrides)
promises.push(this._setDefaultFontFamilies(this._client));
promises.push(this._updateGeolocation(true));
if (!skipDefaultOverrides)
Expand Down
6 changes: 3 additions & 3 deletions packages/playwright-core/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26048,9 +26048,9 @@ export interface ConnectOverCDPOptions {

/**
* When true, Playwright will not apply its default overrides to the existing default browser context. Specifically,
* [`acceptDownloads`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-accept-downloads) is
* left at the browser's setting, focus emulation is not enabled, and media emulation options (such as
* [`colorScheme`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-color-scheme),
* [`acceptDownloads`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-accept-downloads) and
* font families are left at the browser's settings, focus emulation is not enabled, and media emulation options (such
* as [`colorScheme`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-color-scheme),
* [`reducedMotion`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-reduced-motion),
* [`forcedColors`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-forced-colors), and
* [`contrast`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-contrast)) are not applied.
Expand Down
4 changes: 3 additions & 1 deletion tests/library/chromium/connect-over-cdp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,9 @@ test('CD-033 should get title and URL of existing page', async ({ browserType, m
}
});

test('CD-034 should skip default overrides with noDefaults', async ({ browserType, mode, server }, testInfo) => {
test('CD-034 should skip default overrides with noDefaults', {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's undo the changes to the test, except for the annotation.

annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/43715' },
}, async ({ browserType, mode, server }, testInfo) => {
test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/40158' });
const port = 9339 + testInfo.workerIndex;
const browserServer = await browserType.launch({
Expand Down
Loading