打开开发者控制台,从终端打开Chrome

时间:2021-07-19 20:46:40

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?

我可以使用$ google-chrome从命令行运行Google Chrome,但是我可以通过开放式控制台打开它来打开它,最好打开控制台选项卡?

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

我检查了google-chrome的手册页,但它说明了这一点

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 个解决方案

#1


13  

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.

您正在寻找的标志是--auto-open-devtools-for-tabs。请注意,您应该在此设置生效之前退出Chrome。

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

至少自Chrome 55.0.2883.87 m(最新版本)起作用至少

#2


8  

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.

Google员工会维护此自动更新的Chromium标记列表。在打开开发者控制台的情况下打开Chrome似乎没有任何标志。

#3


2  

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.

你到底想要达到什么目的?如果您正在尝试运行某种自动化测试,那么您应该尝试使用PhantomJS。

#4


1  

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

似乎没有这样的选择。我在Chrome产品论坛中添加了一项功能请求https://productforums.google.com/forum/#!category-topic/chrome/give-feature-feedback-and-suggestions/mac/Stable/3HYIAl8_ndc

#1


13  

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.

您正在寻找的标志是--auto-open-devtools-for-tabs。请注意,您应该在此设置生效之前退出Chrome。

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

至少自Chrome 55.0.2883.87 m(最新版本)起作用至少

#2


8  

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.

Google员工会维护此自动更新的Chromium标记列表。在打开开发者控制台的情况下打开Chrome似乎没有任何标志。

#3


2  

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.

你到底想要达到什么目的?如果您正在尝试运行某种自动化测试,那么您应该尝试使用PhantomJS。

#4


1  

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

似乎没有这样的选择。我在Chrome产品论坛中添加了一项功能请求https://productforums.google.com/forum/#!category-topic/chrome/give-feature-feedback-and-suggestions/mac/Stable/3HYIAl8_ndc