Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

open chrome-devtools:// URL from script/command line, NOT via copy paste

In order to automate running and debugging node.js applications the debug URL needs to be opened from a script; eg.:

chromium "chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9230/9229"&

If I copy paste the URL in chromium is working fine. however as I have stated this step needs to be automated.

How to open an URL of the form chrome-devtools://devtools/bundled/inspector.html in chromium/google-chrome from script or command line (Linux)?

like image 348
qt-x Avatar asked Mar 09 '17 10:03

qt-x


2 Answers

It's not clear if your goal is just to have this automated for you, or if you want to figure out a way to script this yourself.

That said, there is a package on NPM called inspect-process that automates the process of opening DevTools windows. (Github). It serves as a replacement on the command-line for node. e.g.:

inspect myScript.js instead of node myScript.js

and it automatically opens up a DevTools window.

If you needed to script this process yourself you could likely use code from that package as well.

like image 104
aidan Avatar answered Oct 19 '22 21:10

aidan


At the moment, this doesn't appear to be possible. I did find this bug report in the Chrome forums.

The only solution I was able to find was to use AppleScript as described here, but you said Linux so that won't be of much help to you.

like image 1
Will Avatar answered Oct 19 '22 22:10

Will