Open Chrome from terminal with developer console open

僤鯓⒐⒋嵵緔 提交于 2020-01-01 07:56:06

问题


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.


回答1:


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)




回答2:


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.




回答3:


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.




回答4:


Seems there is no such option. I added a feature request in Chrome product forum https://productforums.google.com/forum/#!category-topic/chrome/give-feature-feedback-and-suggestions/mac/Stable/3HYIAl8_ndc



来源:https://stackoverflow.com/questions/11301163/open-chrome-from-terminal-with-developer-console-open

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!