Open Chrome from terminal with developer console o

2019-04-18 17:35发布

I can run Google Chrome from the command line using $ google-chrome, but what flag can I pass to open it with developer console already open, preferably open to the console tab?

I checked the man page for google-chrome but it states that

Google Chrome has hundreds of undocumented command-line flags that are added and removed at the whim of the developers.

I'm hoping one of those undocumented flags does what I want.

4条回答
何必那么认真
2楼-- · 2019-04-18 17:56

A Google employee maintains this list of automatically updated Chromium flags. There doesn't seem to be a flag for opening Chrome with developer console open.

查看更多
beautiful°
3楼-- · 2019-04-18 17:56

What exactly are you trying to achieve by that? If you are trying to run some kind of automated tests, you should try out PhantomJS.

查看更多
Anthone
4楼-- · 2019-04-18 17:58
做个烂人
5楼-- · 2019-04-18 18:05

The flag you're looking for is --auto-open-devtools-for-tabs. Please note, that you should quit Chrome before this setting will take effect.

This has worked at least since Chrome 55.0.2883.87 m (the latest version as of initial post)

查看更多
登录 后发表回答