diff --git a/docs/src/api/params.md b/docs/src/api/params.md index 37f6665a93405..d04354f8e0c90 100644 --- a/docs/src/api/params.md +++ b/docs/src/api/params.md @@ -1078,8 +1078,7 @@ Close the browser process on SIGHUP. Defaults to `true`. Whether to run browser in headless mode. More details for [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and -[Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the -[`option: BrowserType.launch.devtools`] option is `true`. +[Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`. ## js-python-browser-option-firefoxuserprefs * langs: js, python @@ -1117,13 +1116,6 @@ disable timeout. If specified, traces are saved into this directory. -## browser-option-devtools -* deprecated: Use [debugging tools](../debug.md) instead. -- `devtools` <[boolean]> - -**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the -[`option: headless`] option will be set `false`. - ## browser-option-slowmo - `slowMo` <[float]> @@ -1133,7 +1125,6 @@ Slows down Playwright operations by the specified amount of milliseconds. Useful - %%-browser-option-args-%% - %%-browser-option-channel-%% - %%-browser-option-chromiumsandbox-%% -- %%-browser-option-devtools-%% - %%-browser-option-downloadspath-%% - %%-csharp-java-browser-option-env-%% - %%-js-browser-option-env-%% diff --git a/packages/playwright-client/types/types.d.ts b/packages/playwright-client/types/types.d.ts index 5e9b254130457..d6ff2f0aceead 100644 --- a/packages/playwright-client/types/types.d.ts +++ b/packages/playwright-client/types/types.d.ts @@ -14998,14 +14998,6 @@ export interface BrowserType { */ deviceScaleFactor?: number; - /** - * **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the - * [`headless`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context-option-headless) - * option will be set `false`. - * @deprecated Use [debugging tools](https://playwright.dev/docs/debug) instead. - */ - devtools?: boolean; - /** * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and * is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were @@ -15085,9 +15077,7 @@ export interface BrowserType { /** * Whether to run browser in headless mode. More details for * [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and - * [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the - * [`devtools`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-devtools) option is - * `true`. + * [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`. */ headless?: boolean; @@ -15428,14 +15418,6 @@ export interface BrowserType { */ chromiumSandbox?: boolean; - /** - * **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the - * [`headless`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-server-option-headless) option - * will be set `false`. - * @deprecated Use [debugging tools](https://playwright.dev/docs/debug) instead. - */ - devtools?: boolean; - /** * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and * is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were @@ -15480,9 +15462,7 @@ export interface BrowserType { /** * Whether to run browser in headless mode. More details for * [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and - * [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the - * [`devtools`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-devtools) option is - * `true`. + * [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`. */ headless?: boolean; @@ -21763,14 +21743,6 @@ export interface LaunchOptions { */ chromiumSandbox?: boolean; - /** - * **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the - * [`headless`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-headless) option will be - * set `false`. - * @deprecated Use [debugging tools](https://playwright.dev/docs/debug) instead. - */ - devtools?: boolean; - /** * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and * is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were @@ -21815,9 +21787,7 @@ export interface LaunchOptions { /** * Whether to run browser in headless mode. More details for * [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and - * [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the - * [`devtools`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-devtools) option is - * `true`. + * [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`. */ headless?: boolean; diff --git a/packages/playwright-core/src/protocol/validator.ts b/packages/playwright-core/src/protocol/validator.ts index 18980d8e18b46..91f26b64c69be 100644 --- a/packages/playwright-core/src/protocol/validator.ts +++ b/packages/playwright-core/src/protocol/validator.ts @@ -506,7 +506,6 @@ scheme.BrowserTypeLaunchParams = tObject({ timeout: tFloat, env: tOptional(tArray(tType('NameValue'))), headless: tOptional(tBoolean), - devtools: tOptional(tBoolean), proxy: tOptional(tObject({ server: tString, bypass: tOptional(tString), @@ -536,7 +535,6 @@ scheme.BrowserTypeLaunchPersistentContextParams = tObject({ timeout: tFloat, env: tOptional(tArray(tType('NameValue'))), headless: tOptional(tBoolean), - devtools: tOptional(tBoolean), proxy: tOptional(tObject({ server: tString, bypass: tOptional(tString), diff --git a/packages/playwright-core/src/remote/playwrightServer.ts b/packages/playwright-core/src/remote/playwrightServer.ts index a22ec51bd367e..e901bf508b7a5 100644 --- a/packages/playwright-core/src/remote/playwrightServer.ts +++ b/packages/playwright-core/src/remote/playwrightServer.ts @@ -375,7 +375,6 @@ const defaultLaunchOptions: Partial = { handleSIGTERM: false, handleSIGHUP: false, headless: true, - devtools: false, }; const optionsThatAllowBrowserReuse: (keyof LaunchOptionsWithTimeout)[] = [ diff --git a/packages/playwright-core/src/server/bidi/bidiChromium.ts b/packages/playwright-core/src/server/bidi/bidiChromium.ts index e05e023875e6d..18071378b0076 100644 --- a/packages/playwright-core/src/server/bidi/bidiChromium.ts +++ b/packages/playwright-core/src/server/bidi/bidiChromium.ts @@ -123,8 +123,6 @@ export class BidiChromium extends BrowserType { chromeArguments.push('--enable-unsafe-swiftshader'); } - if (options.devtools) - chromeArguments.push('--auto-open-devtools-for-tabs'); if (options.headless) { chromeArguments.push('--headless'); diff --git a/packages/playwright-core/src/server/browserType.ts b/packages/playwright-core/src/server/browserType.ts index e370491788b1b..b4f843f22ae93 100644 --- a/packages/playwright-core/src/server/browserType.ts +++ b/packages/playwright-core/src/server/browserType.ts @@ -293,15 +293,14 @@ export abstract class BrowserType extends SdkObject { } private _validateLaunchOptions(options: types.LaunchOptions): types.LaunchOptions { - const { devtools = false } = options; - let { headless = !devtools, downloadsPath, proxy } = options; + let { headless = true, downloadsPath, proxy } = options; if (debugMode() === 'inspector') headless = false; if (downloadsPath && !path.isAbsolute(downloadsPath)) downloadsPath = path.join(process.cwd(), downloadsPath); if (options.socksProxyPort) proxy = { server: `socks5://127.0.0.1:${options.socksProxyPort}` }; - return { ...options, devtools, headless, downloadsPath, proxy }; + return { ...options, headless, downloadsPath, proxy }; } protected _createUserDataDirArgMisuseError(userDataDirArg: string): Error { diff --git a/packages/playwright-core/src/server/chromium/chromium.ts b/packages/playwright-core/src/server/chromium/chromium.ts index 4adebfe579c3d..6eff859ae7d98 100644 --- a/packages/playwright-core/src/server/chromium/chromium.ts +++ b/packages/playwright-core/src/server/chromium/chromium.ts @@ -141,13 +141,8 @@ export class Chromium extends BrowserType { } override async connectToTransport(transport: ConnectionTransport, options: BrowserOptions, browserLogsCollector: RecentLogsCollector): Promise { - let devtools = this._devtools; - if ((options as any).__testHookForDevTools) { - devtools = this._createDevTools(); - await (options as any).__testHookForDevTools(devtools); - } try { - return await CRBrowser.connect(this.attribution.playwright, transport, options, devtools); + return await CRBrowser.connect(this.attribution.playwright, transport, options, this._devtools); } catch (e) { if (browserLogsCollector.recentLogs().some(log => log.includes('Failed to create a ProcessSingleton for your profile directory.'))) { throw new Error( @@ -326,8 +321,6 @@ export class Chromium extends BrowserType { chromeArguments.push('--enable-unsafe-swiftshader'); } - if (options.devtools) - chromeArguments.push('--auto-open-devtools-for-tabs'); if (options.headless) { chromeArguments.push('--headless'); diff --git a/packages/playwright-core/src/server/chromium/crDevTools.ts b/packages/playwright-core/src/server/chromium/crDevTools.ts index 5225d6d54f4ec..74aa11c64571b 100644 --- a/packages/playwright-core/src/server/chromium/crDevTools.ts +++ b/packages/playwright-core/src/server/chromium/crDevTools.ts @@ -26,7 +26,6 @@ export class CRDevTools { private _preferencesPath: string; private _prefs: any; private _savePromise: Promise; - __testHookOnBinding?: (parsed: any) => any; constructor(preferencesPath: string) { this._preferencesPath = preferencesPath; @@ -39,8 +38,6 @@ export class CRDevTools { return; const parsed = JSON.parse(event.payload); let result = undefined; - if (this.__testHookOnBinding) - this.__testHookOnBinding(parsed); if (parsed.method === 'getPreferences') { if (this._prefs === undefined) { try { diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts index 5e9b254130457..d6ff2f0aceead 100644 --- a/packages/playwright-core/types/types.d.ts +++ b/packages/playwright-core/types/types.d.ts @@ -14998,14 +14998,6 @@ export interface BrowserType { */ deviceScaleFactor?: number; - /** - * **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the - * [`headless`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context-option-headless) - * option will be set `false`. - * @deprecated Use [debugging tools](https://playwright.dev/docs/debug) instead. - */ - devtools?: boolean; - /** * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and * is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were @@ -15085,9 +15077,7 @@ export interface BrowserType { /** * Whether to run browser in headless mode. More details for * [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and - * [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the - * [`devtools`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-devtools) option is - * `true`. + * [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`. */ headless?: boolean; @@ -15428,14 +15418,6 @@ export interface BrowserType { */ chromiumSandbox?: boolean; - /** - * **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the - * [`headless`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-server-option-headless) option - * will be set `false`. - * @deprecated Use [debugging tools](https://playwright.dev/docs/debug) instead. - */ - devtools?: boolean; - /** * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and * is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were @@ -15480,9 +15462,7 @@ export interface BrowserType { /** * Whether to run browser in headless mode. More details for * [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and - * [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the - * [`devtools`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-devtools) option is - * `true`. + * [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`. */ headless?: boolean; @@ -21763,14 +21743,6 @@ export interface LaunchOptions { */ chromiumSandbox?: boolean; - /** - * **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the - * [`headless`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-headless) option will be - * set `false`. - * @deprecated Use [debugging tools](https://playwright.dev/docs/debug) instead. - */ - devtools?: boolean; - /** * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and * is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were @@ -21815,9 +21787,7 @@ export interface LaunchOptions { /** * Whether to run browser in headless mode. More details for * [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and - * [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the - * [`devtools`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-devtools) option is - * `true`. + * [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`. */ headless?: boolean; diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts index 3a9817f1fa635..6691642fc150f 100644 --- a/packages/playwright/types/test.d.ts +++ b/packages/playwright/types/test.d.ts @@ -6747,9 +6747,7 @@ export interface PlaywrightWorkerOptions { /** * Whether to run browser in headless mode. More details for * [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and - * [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the - * [`devtools`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-devtools) option is - * `true`. + * [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`. * * **Usage** * diff --git a/packages/protocol/src/channels.d.ts b/packages/protocol/src/channels.d.ts index 8a2e3db8acef4..9b5239591615a 100644 --- a/packages/protocol/src/channels.d.ts +++ b/packages/protocol/src/channels.d.ts @@ -887,7 +887,6 @@ export type BrowserTypeLaunchParams = { timeout: number, env?: NameValue[], headless?: boolean, - devtools?: boolean, proxy?: { server: string, bypass?: string, @@ -913,7 +912,6 @@ export type BrowserTypeLaunchOptions = { handleSIGHUP?: boolean, env?: NameValue[], headless?: boolean, - devtools?: boolean, proxy?: { server: string, bypass?: string, @@ -943,7 +941,6 @@ export type BrowserTypeLaunchPersistentContextParams = { timeout: number, env?: NameValue[], headless?: boolean, - devtools?: boolean, proxy?: { server: string, bypass?: string, @@ -1026,7 +1023,6 @@ export type BrowserTypeLaunchPersistentContextOptions = { handleSIGHUP?: boolean, env?: NameValue[], headless?: boolean, - devtools?: boolean, proxy?: { server: string, bypass?: string, diff --git a/packages/protocol/src/protocol.yml b/packages/protocol/src/protocol.yml index 2f535bf6448e9..a9573b1bcb23e 100644 --- a/packages/protocol/src/protocol.yml +++ b/packages/protocol/src/protocol.yml @@ -467,7 +467,6 @@ LaunchOptions: type: array? items: NameValue headless: boolean? - devtools: boolean? proxy: type: object? properties: diff --git a/tests/library/chromium/launcher.spec.ts b/tests/library/chromium/launcher.spec.ts index 4d03dd2e4ae9a..6c63b03c7a673 100644 --- a/tests/library/chromium/launcher.spec.ts +++ b/tests/library/chromium/launcher.spec.ts @@ -34,24 +34,6 @@ it('should not throw with remote-debugging-port argument', async ({ browserType, await browser.close(); }); -it('should open devtools when "devtools: true" option is given', async ({ browserType, mode, platform, channel }) => { - it.skip(mode !== 'default' || platform === 'win32' || !!channel); - - let devtoolsCallback; - const devtoolsPromise = new Promise(f => devtoolsCallback = f); - const __testHookForDevTools = devtools => devtools.__testHookOnBinding = parsed => { - if (parsed.method === 'getPreferences') - devtoolsCallback(); - }; - const browser = await browserType.launch({ headless: false, devtools: true, __testHookForDevTools } as any); - const context = await browser.newContext(); - await Promise.all([ - devtoolsPromise, - context.newPage() - ]); - await browser.close(); -}); - it('should not create pages automatically', async ({ browserType }) => { const browser = await browserType.launch(); const browserSession = await browser.newBrowserCDPSession(); diff --git a/tests/library/playwright.config.ts b/tests/library/playwright.config.ts index fdfbfb66b3372..4fbe899ceec16 100644 --- a/tests/library/playwright.config.ts +++ b/tests/library/playwright.config.ts @@ -113,7 +113,6 @@ for (const browserName of browserNames) { const executablePath = getExecutablePath(browserName); if (executablePath && !process.env.TEST_WORKER_INDEX) console.error(`Using executable at ${executablePath}`); - const devtools = process.env.DEVTOOLS === '1'; const testIgnore: RegExp[] = browserNames.filter(b => b !== browserName).map(b => new RegExp(b)); const projectTemplate: typeof config.projects[0] = { @@ -127,7 +126,6 @@ for (const browserName of browserNames) { video: video ? 'on' : undefined, launchOptions: { executablePath, - devtools }, trace: trace ? 'on' : undefined, }, diff --git a/utils/generate_types/test/test.ts b/utils/generate_types/test/test.ts index a71dab64b0b6a..aba75945974ef 100644 --- a/utils/generate_types/test/test.ts +++ b/utils/generate_types/test/test.ts @@ -226,7 +226,6 @@ playwright.chromium.launch().then(async browser => { // Test v0.12 features (async () => { const launchOptions: playwright.LaunchOptions = { - devtools: true, env: { TIMEOUT: '52', SOMETHING: '/some/path',