Is it possible to use remote debugging protocol in Phantomjs or other headless webkit browsers?

294 views
Skip to first unread message

Chen Yang

unread,
Mar 4, 2016, 1:27:13 AM3/4/16
to Google Chrome Developer Tools
I want to use remote debugging protocol on a linux server.It seems Chrome can't work on it.So I use Phantomjs.
I can use a remote inspector in Phantomjs.But I can't use remote debugging protocol directly in Phantomjs.
So I want to know if there is a way to use remote debugging protocol in a headless webkit browser.
And is there any way to let Chrome work on linux server?

PhistucK

unread,
Mar 4, 2016, 4:14:59 AM3/4/16
to Google Chrome Developer Tools
You should take this question to a PhantomJS or other headless WebKit based browser groups.

What does running on a Linux server entail? No X server?
I recently saw that a headless Chrome is in the works, so that might be the answer when (if) it is done.
Star crbug.com/546953 for updates.


PhistucK

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/586b63f6-7bc6-4e90-9ae4-10bd80794924%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrey Sidorov

unread,
Mar 4, 2016, 8:12:45 PM3/4/16
to Google Chrome Developer Tools
yes, via --remote-debugger-port cmd line option - see http://phantomjs.org/api/command-line.html

 I can't use remote debugging protocol directly in Phantomjs.
what do you mean by this? It might listen on localhost only, so if you want to connect from outside you maybe need to forward port

Chen Yang

unread,
Mar 7, 2016, 12:44:04 AM3/7/16
to Google Chrome Developer Tools
I know --remote-debugger-port. And it just open a web inspector.But I can't use http://chromedevtools.github.io/debugger-protocol-viewer/ on this debugger port.  

Andrey Sidorov

unread,
Mar 7, 2016, 5:32:48 PM3/7/16
to Google Chrome Developer Tools
Looks like top level protocol is different ( no http://localhost:9222/json etc ) but websocket connection is using same remote debugging protocol as normal chrome. Just make your debugger connect to 'ws://localhost:9222/devtools/page/1' 

Andrey Sidorov

unread,
Mar 7, 2016, 10:35:39 PM3/7/16
to Google Chrome Developer Tools
I was able to connect my client ( https://github.com/sidorares/crconsole ) to it. If you want t give a try: `npm install -g crconsole && crconsole -w ws://localhost:9222/devtools/page/1` after starting phantomjs with --remote-debugger-port=9222 switch

Chen Yang

unread,
Mar 16, 2016, 12:48:14 AM3/16/16
to Google Chrome Developer Tools
Thank you very much.I will try your way.

I found another way to do this.I used Xvfb to run headless google-chrome on a linux server.And the protocol works well on it.
Reply all
Reply to author
Forward
0 new messages