Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Launcher): add devtools option #953

Merged

Conversation

vsemozhetbyt
Copy link
Contributor

@vsemozhetbyt vsemozhetbyt commented Oct 5, 2017

Fixes: #864 (see #864 (comment))
Refs: https://peter.sh/experiments/chromium-command-line-switches/#auto-open-devtools-for-tabs

Unfortunately, I do not know if this option needs a test and how it should be tested if needed. Please, let me know what code should I add to the tests,

@paulirish
Copy link
Collaborator

Personally I think this is better solved with manually adding that flag like:

puppeteer.launch({args: ['--auto-open-devtools-for-tabs']})

@aslushnikov
Copy link
Contributor

@paulirish The bare-bone flag is a minimalistic approach yet not very convenient.

devtools option is nice because:

  • it's hard to memorize the chrome flag
  • the devtools option costs nothing to maintain
  • it's a feature parity with nightmare

Copy link
Collaborator

@JoelEinbinder JoelEinbinder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it.

lib/Launcher.js Outdated
@@ -80,6 +80,8 @@ class Launcher {
'--mute-audio'
);
}
if (options.headless === false && options.devtools === true)
chromeArguments.push('--auto-open-devtools-for-tabs');
Copy link
Collaborator

@paulirish paulirish Oct 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vsemozhetbyt we discussed and folks are comfortable with this. (including me. :)

can you also set options.headless = false automatically if devtools is true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've amended. Is it OK now?

@aslushnikov aslushnikov merged commit f1aa18a into puppeteer:master Oct 10, 2017
@vsemozhetbyt vsemozhetbyt deleted the auto-open-devtools-for-tabs branch October 10, 2017 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants