Skip to content

Commit d38ea35

Browse files
committed
chore: remove deprecated devtools option
This can be achieved by passing `args: ['--auto-open-devtools-for-tabs']` instead.
1 parent 44664ab commit d38ea35

File tree

13 files changed

+11
-121
lines changed

13 files changed

+11
-121
lines changed

docs/src/api/params.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,8 +1078,7 @@ Close the browser process on SIGHUP. Defaults to `true`.
10781078

10791079
Whether to run browser in headless mode. More details for
10801080
[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and
1081-
[Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the
1082-
[`option: BrowserType.launch.devtools`] option is `true`.
1081+
[Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`.
10831082

10841083
## js-python-browser-option-firefoxuserprefs
10851084
* langs: js, python
@@ -1117,13 +1116,6 @@ disable timeout.
11171116

11181117
If specified, traces are saved into this directory.
11191118

1120-
## browser-option-devtools
1121-
* deprecated: Use [debugging tools](../debug.md) instead.
1122-
- `devtools` <[boolean]>
1123-
1124-
**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the
1125-
[`option: headless`] option will be set `false`.
1126-
11271119
## browser-option-slowmo
11281120
- `slowMo` <[float]>
11291121

@@ -1133,7 +1125,6 @@ Slows down Playwright operations by the specified amount of milliseconds. Useful
11331125
- %%-browser-option-args-%%
11341126
- %%-browser-option-channel-%%
11351127
- %%-browser-option-chromiumsandbox-%%
1136-
- %%-browser-option-devtools-%%
11371128
- %%-browser-option-downloadspath-%%
11381129
- %%-csharp-java-browser-option-env-%%
11391130
- %%-js-browser-option-env-%%

packages/playwright-client/types/types.d.ts

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14998,14 +14998,6 @@ export interface BrowserType<Unused = {}> {
1499814998
*/
1499914999
deviceScaleFactor?: number;
1500015000

15001-
/**
15002-
* **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the
15003-
* [`headless`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context-option-headless)
15004-
* option will be set `false`.
15005-
* @deprecated Use [debugging tools](https://playwright.dev/docs/debug) instead.
15006-
*/
15007-
devtools?: boolean;
15008-
1500915001
/**
1501015002
* If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and
1501115003
* 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<Unused = {}> {
1508515077
/**
1508615078
* Whether to run browser in headless mode. More details for
1508715079
* [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and
15088-
* [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the
15089-
* [`devtools`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-devtools) option is
15090-
* `true`.
15080+
* [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`.
1509115081
*/
1509215082
headless?: boolean;
1509315083

@@ -15428,14 +15418,6 @@ export interface BrowserType<Unused = {}> {
1542815418
*/
1542915419
chromiumSandbox?: boolean;
1543015420

15431-
/**
15432-
* **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the
15433-
* [`headless`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-server-option-headless) option
15434-
* will be set `false`.
15435-
* @deprecated Use [debugging tools](https://playwright.dev/docs/debug) instead.
15436-
*/
15437-
devtools?: boolean;
15438-
1543915421
/**
1544015422
* If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and
1544115423
* 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<Unused = {}> {
1548015462
/**
1548115463
* Whether to run browser in headless mode. More details for
1548215464
* [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and
15483-
* [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the
15484-
* [`devtools`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-devtools) option is
15485-
* `true`.
15465+
* [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`.
1548615466
*/
1548715467
headless?: boolean;
1548815468

@@ -21763,14 +21743,6 @@ export interface LaunchOptions {
2176321743
*/
2176421744
chromiumSandbox?: boolean;
2176521745

21766-
/**
21767-
* **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the
21768-
* [`headless`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-headless) option will be
21769-
* set `false`.
21770-
* @deprecated Use [debugging tools](https://playwright.dev/docs/debug) instead.
21771-
*/
21772-
devtools?: boolean;
21773-
2177421746
/**
2177521747
* If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and
2177621748
* 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 {
2181521787
/**
2181621788
* Whether to run browser in headless mode. More details for
2181721789
* [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and
21818-
* [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the
21819-
* [`devtools`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-devtools) option is
21820-
* `true`.
21790+
* [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`.
2182121791
*/
2182221792
headless?: boolean;
2182321793

packages/playwright-core/src/protocol/validator.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,6 @@ scheme.BrowserTypeLaunchParams = tObject({
506506
timeout: tFloat,
507507
env: tOptional(tArray(tType('NameValue'))),
508508
headless: tOptional(tBoolean),
509-
devtools: tOptional(tBoolean),
510509
proxy: tOptional(tObject({
511510
server: tString,
512511
bypass: tOptional(tString),
@@ -536,7 +535,6 @@ scheme.BrowserTypeLaunchPersistentContextParams = tObject({
536535
timeout: tFloat,
537536
env: tOptional(tArray(tType('NameValue'))),
538537
headless: tOptional(tBoolean),
539-
devtools: tOptional(tBoolean),
540538
proxy: tOptional(tObject({
541539
server: tString,
542540
bypass: tOptional(tString),

packages/playwright-core/src/remote/playwrightServer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ const defaultLaunchOptions: Partial<LaunchOptionsWithTimeout> = {
375375
handleSIGTERM: false,
376376
handleSIGHUP: false,
377377
headless: true,
378-
devtools: false,
379378
};
380379

381380
const optionsThatAllowBrowserReuse: (keyof LaunchOptionsWithTimeout)[] = [

packages/playwright-core/src/server/bidi/bidiChromium.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ export class BidiChromium extends BrowserType {
123123
chromeArguments.push('--enable-unsafe-swiftshader');
124124
}
125125

126-
if (options.devtools)
127-
chromeArguments.push('--auto-open-devtools-for-tabs');
128126
if (options.headless) {
129127
chromeArguments.push('--headless');
130128

packages/playwright-core/src/server/browserType.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,15 +293,14 @@ export abstract class BrowserType extends SdkObject {
293293
}
294294

295295
private _validateLaunchOptions(options: types.LaunchOptions): types.LaunchOptions {
296-
const { devtools = false } = options;
297-
let { headless = !devtools, downloadsPath, proxy } = options;
296+
let { headless, downloadsPath, proxy } = options;
298297
if (debugMode() === 'inspector')
299298
headless = false;
300299
if (downloadsPath && !path.isAbsolute(downloadsPath))
301300
downloadsPath = path.join(process.cwd(), downloadsPath);
302301
if (options.socksProxyPort)
303302
proxy = { server: `socks5://127.0.0.1:${options.socksProxyPort}` };
304-
return { ...options, devtools, headless, downloadsPath, proxy };
303+
return { ...options, headless, downloadsPath, proxy };
305304
}
306305

307306
protected _createUserDataDirArgMisuseError(userDataDirArg: string): Error {

packages/playwright-core/src/server/chromium/chromium.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,8 @@ export class Chromium extends BrowserType {
141141
}
142142

143143
override async connectToTransport(transport: ConnectionTransport, options: BrowserOptions, browserLogsCollector: RecentLogsCollector): Promise<CRBrowser> {
144-
let devtools = this._devtools;
145-
if ((options as any).__testHookForDevTools) {
146-
devtools = this._createDevTools();
147-
await (options as any).__testHookForDevTools(devtools);
148-
}
149144
try {
150-
return await CRBrowser.connect(this.attribution.playwright, transport, options, devtools);
145+
return await CRBrowser.connect(this.attribution.playwright, transport, options, this._devtools);
151146
} catch (e) {
152147
if (browserLogsCollector.recentLogs().some(log => log.includes('Failed to create a ProcessSingleton for your profile directory.'))) {
153148
throw new Error(
@@ -326,8 +321,6 @@ export class Chromium extends BrowserType {
326321
chromeArguments.push('--enable-unsafe-swiftshader');
327322
}
328323

329-
if (options.devtools)
330-
chromeArguments.push('--auto-open-devtools-for-tabs');
331324
if (options.headless) {
332325
chromeArguments.push('--headless');
333326

packages/playwright-core/src/server/chromium/crDevTools.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export class CRDevTools {
2626
private _preferencesPath: string;
2727
private _prefs: any;
2828
private _savePromise: Promise<any>;
29-
__testHookOnBinding?: (parsed: any) => any;
3029

3130
constructor(preferencesPath: string) {
3231
this._preferencesPath = preferencesPath;
@@ -39,8 +38,6 @@ export class CRDevTools {
3938
return;
4039
const parsed = JSON.parse(event.payload);
4140
let result = undefined;
42-
if (this.__testHookOnBinding)
43-
this.__testHookOnBinding(parsed);
4441
if (parsed.method === 'getPreferences') {
4542
if (this._prefs === undefined) {
4643
try {

packages/playwright-core/types/types.d.ts

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14998,14 +14998,6 @@ export interface BrowserType<Unused = {}> {
1499814998
*/
1499914999
deviceScaleFactor?: number;
1500015000

15001-
/**
15002-
* **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the
15003-
* [`headless`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context-option-headless)
15004-
* option will be set `false`.
15005-
* @deprecated Use [debugging tools](https://playwright.dev/docs/debug) instead.
15006-
*/
15007-
devtools?: boolean;
15008-
1500915001
/**
1501015002
* If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and
1501115003
* 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<Unused = {}> {
1508515077
/**
1508615078
* Whether to run browser in headless mode. More details for
1508715079
* [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and
15088-
* [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the
15089-
* [`devtools`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-devtools) option is
15090-
* `true`.
15080+
* [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`.
1509115081
*/
1509215082
headless?: boolean;
1509315083

@@ -15428,14 +15418,6 @@ export interface BrowserType<Unused = {}> {
1542815418
*/
1542915419
chromiumSandbox?: boolean;
1543015420

15431-
/**
15432-
* **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the
15433-
* [`headless`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-server-option-headless) option
15434-
* will be set `false`.
15435-
* @deprecated Use [debugging tools](https://playwright.dev/docs/debug) instead.
15436-
*/
15437-
devtools?: boolean;
15438-
1543915421
/**
1544015422
* If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and
1544115423
* 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<Unused = {}> {
1548015462
/**
1548115463
* Whether to run browser in headless mode. More details for
1548215464
* [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and
15483-
* [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the
15484-
* [`devtools`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-devtools) option is
15485-
* `true`.
15465+
* [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`.
1548615466
*/
1548715467
headless?: boolean;
1548815468

@@ -21763,14 +21743,6 @@ export interface LaunchOptions {
2176321743
*/
2176421744
chromiumSandbox?: boolean;
2176521745

21766-
/**
21767-
* **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the
21768-
* [`headless`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-headless) option will be
21769-
* set `false`.
21770-
* @deprecated Use [debugging tools](https://playwright.dev/docs/debug) instead.
21771-
*/
21772-
devtools?: boolean;
21773-
2177421746
/**
2177521747
* If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and
2177621748
* 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 {
2181521787
/**
2181621788
* Whether to run browser in headless mode. More details for
2181721789
* [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and
21818-
* [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the
21819-
* [`devtools`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-devtools) option is
21820-
* `true`.
21790+
* [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`.
2182121791
*/
2182221792
headless?: boolean;
2182321793

packages/playwright/types/test.d.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6747,9 +6747,7 @@ export interface PlaywrightWorkerOptions {
67476747
/**
67486748
* Whether to run browser in headless mode. More details for
67496749
* [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and
6750-
* [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the
6751-
* [`devtools`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-devtools) option is
6752-
* `true`.
6750+
* [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`.
67536751
*
67546752
* **Usage**
67556753
*

0 commit comments

Comments
 (0)