question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bikeshed changing default chrome flags used.

See original GitHub issue

Breaking this out from #38 where we explored this the most. cc @ragingwind

Here is the node module API implemented in #38 (let’s call this JS vAlpha API):

chromeLauncher.defaultFlags() // array of all the flags it uses by default

chromeLauncher.launch({
  ignoreDefaultFlags: true,  // will not supply any defaults.. the ones passed in below are it.
  chromeFlags: [] // array of the only flags to use
});

and a CLI vAlpha API:

chrome-launcher --list-flags # prints and quits: '--disable-extensions --disable-translate-service ....'

chrome-launcher # launches with default flags
chrome-launcher --set-flags="--show-paint-rects --disable-extensions"   # skips default flags and only uses provided ones
# naming: maybe "override-flags" to indicate this may break things..

# also allow just augmenting default flags with --add-flags
chrome-launcher --add-flags="--show-paint-rects"
# (this behavior is what lighthouse's current --chrome-flags arg does)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
patrickhulcecommented, Jul 17, 2019

Yes @Gudahtt I believe we consider this resolved by https://github.com/GoogleChrome/chrome-launcher/pull/124. We can revisit a future date if there becomes a stronger need for a CLI.

1reaction
paulirishcommented, Dec 5, 2017

As discussed with @patrickhulce here’s a JS vGamma API:

const flags = chromeLauncher.defaultFlags() // Map of all the flags it uses by default

flags.delete('--disable-extensions');
flags.delete('--mute-audio');
flags.set('--user-data-dir', somepath);

chromeLauncher.launch({chromeFlags: flags});

And we’d use a little duck typing:

  • If chromeFlags is an array, add the results on to the default flags.
  • If chromeFlags is a map, do not apply default flags and only use the provided ones (plus remote-debugging-port).

(While this has a very different API than the CLI, it kinda makes sense that they do.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

What are Chrome flags?
To set a flag from the chrome://flags page in Chrome, you need to find the flag, toggle the setting for the flag, then...
Read more >
The 7 Chrome Flags You Should Enable (And 2 You Shouldn't)
Chrome Flags that make your browsing experience exponentially better · 1. Show Autofill predictions · 2. Tab freeze and discard · 3. Parallel...
Read more >
Bikeshed Documentation - GitHub Pages
The files value provides the default values, which you probably want to just extend, rather than fully replace. It defaults to ["images", " ......
Read more >
Chrome Flags: What are they and how to enable them
To get started using Chrome flags, you will need to first open Chrome on your PC or ChromeOS device. There, that was easy...
Read more >
What determines 'Default' value in chrome://flags
(.gyp or source code?) Why the default value is different between developer build and official build. How can I set default values in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found