From f395cc37659bd0cfdffa9d892a3ef7aee8e26941 Mon Sep 17 00:00:00 2001 From: Benedikt Meurer Date: Tue, 18 Mar 2025 14:20:33 +0100 Subject: [PATCH] [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 Reviewed-by: Mathias Bynens Auto-Submit: Benedikt Meurer --- docs/get_the_code.md | 8 +------- scripts/run_start.py | 18 +++++------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/docs/get_the_code.md b/docs/get_the_code.md index f16cd104a9..d92d081551 100644 --- a/docs/get_the_code.md +++ b/docs/get_the_code.md @@ -100,13 +100,7 @@ npm start -- --canary ``` to run in Chrome Canary instead of Chrome for Testing; this requires you to install Chrome Canary manually first -(Googlers can install `google-chrome-canary` on gLinux). You can use - -```bash -npm start -- --enable-feature=MediaRouter --disable-feature=DevToolsWellKnown -``` - -to enable/disable features as needed; the command line flags take precedence over the defaults. And finally use +(Googlers can install `google-chrome-canary` on gLinux). And finally use ```bash npm start -- http://www.example.com diff --git a/scripts/run_start.py b/scripts/run_start.py index dd4dd10b73..62bf3f2971 100755 --- a/scripts/run_start.py +++ b/scripts/run_start.py @@ -47,14 +47,6 @@ def parse_options(args): const='canary', dest='browser', help='launch in Chrome Canary') - parser.add_argument('--enable-features', - action='append', - default=[], - help='enable experimental Chrome features') - parser.add_argument('--disable-features', - action='append', - default=[], - help='disable experimental Chrome features') parser.add_argument('--no-auto-open-devtools-for-tabs', action='store_true', help='don\'t automatically open DevTools for new tabs') @@ -119,11 +111,11 @@ def start(options): if platform.system() == 'Darwin': args += ['--use-mock-keychain'] - # Disable/Enable experimental features, starting with defaults. - args += ['--disable-features=%s' % f for f in DISABLE_FEATURES] - args += ['--enable-features=%s' % f for f in ENABLE_FEATURES] - args += ['--disable-features=%s' % f for f in options.disable_features] - args += ['--enable-features=%s' % f for f in options.enable_features] + # Disable/Enable experimental features. + if len(DISABLE_FEATURES) > 0: + args += ['--disable-features=%s' % ','.join(DISABLE_FEATURES)] + if len(ENABLE_FEATURES) > 0: + args += ['--enable-features=%s' % ','.join(ENABLE_FEATURES)] # Open with our freshly built DevTools front-end. args += [