Skip to content

Commit f395cc3

Browse files
committed
[npm] Fix enabled/disabled features.
Pass only a single `--disable-features=` / `--enable-features` CLI flag to Chrome binary. Bug: 404192426 Change-Id: I858f87b41e9328cb0e3b9a5c7e16a0f57a73be53 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6367217 Commit-Queue: Mathias Bynens <[email protected]> Reviewed-by: Mathias Bynens <[email protected]> Auto-Submit: Benedikt Meurer <[email protected]>
1 parent 06791eb commit f395cc3

File tree

2 files changed

+6
-20
lines changed

2 files changed

+6
-20
lines changed

docs/get_the_code.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,7 @@ npm start -- --canary
100100
```
101101

102102
to run in Chrome Canary instead of Chrome for Testing; this requires you to install Chrome Canary manually first
103-
(Googlers can install `google-chrome-canary` on gLinux). You can use
104-
105-
```bash
106-
npm start -- --enable-feature=MediaRouter --disable-feature=DevToolsWellKnown
107-
```
108-
109-
to enable/disable features as needed; the command line flags take precedence over the defaults. And finally use
103+
(Googlers can install `google-chrome-canary` on gLinux). And finally use
110104

111105
```bash
112106
npm start -- http://www.example.com

scripts/run_start.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,6 @@ def parse_options(args):
4747
const='canary',
4848
dest='browser',
4949
help='launch in Chrome Canary')
50-
parser.add_argument('--enable-features',
51-
action='append',
52-
default=[],
53-
help='enable experimental Chrome features')
54-
parser.add_argument('--disable-features',
55-
action='append',
56-
default=[],
57-
help='disable experimental Chrome features')
5850
parser.add_argument('--no-auto-open-devtools-for-tabs',
5951
action='store_true',
6052
help='don\'t automatically open DevTools for new tabs')
@@ -119,11 +111,11 @@ def start(options):
119111
if platform.system() == 'Darwin':
120112
args += ['--use-mock-keychain']
121113

122-
# Disable/Enable experimental features, starting with defaults.
123-
args += ['--disable-features=%s' % f for f in DISABLE_FEATURES]
124-
args += ['--enable-features=%s' % f for f in ENABLE_FEATURES]
125-
args += ['--disable-features=%s' % f for f in options.disable_features]
126-
args += ['--enable-features=%s' % f for f in options.enable_features]
114+
# Disable/Enable experimental features.
115+
if len(DISABLE_FEATURES) > 0:
116+
args += ['--disable-features=%s' % ','.join(DISABLE_FEATURES)]
117+
if len(ENABLE_FEATURES) > 0:
118+
args += ['--enable-features=%s' % ','.join(ENABLE_FEATURES)]
127119

128120
# Open with our freshly built DevTools front-end.
129121
args += [

0 commit comments

Comments
 (0)