Remote Debugging with a Java Client?

1,118 views
Skip to first unread message

c

unread,
May 15, 2011, 4:11:31 PM5/15/11
to google-chrome-...@googlegroups.com
I'm retrieving webSocketDebuggerUrl from http://localhost:9222/json and connecting with a Java websocket library.  When I attempt to send messages in the DRAFT76 protocol, no responses are sent back.  Is there a known good Java websocket library that works with the latest Chrome dev build?  Has anyone succeeded in using remote debugging with a Java client?

http://code.google.com/chrome/devtools/docs/remote-debugging.html

Peter Rybin

unread,
May 16, 2011, 9:17:15 AM5/16/11
to Google Chrome Developer Tools
Hi Consiliens

There is a Java library in a project http://code.google.com/p/chromedevtools/
(see SDK part).

This Java library provides API to JavaScript debugger. It supports
connections to Chrome via old debug protocol, to V8 via its debug
protocol. And the support for WebInspector protocol (there-called WIP)
is being developed right now.

You can take a look at WebSocket implementation here:
http://code.google.com/p/chromedevtools/source/browse/#svn%2Ftrunk%2Fplugins%2Forg.chromium.sdk%2Fsrc%2Forg%2Fchromium%2Fsdk%2Finternal%2Fwebsocket
(Specified by Internet-Draft of May 23, 2010,
http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00 )

You also could try running the whole library -- starting from
WipBrowserFactory class (see http://code.google.com/p/chromedevtools/wiki/HowToBuild
). Note that the implementation is rather incomplete by now.

Feel free to ask me if you have some questions about the sources.

Peter





On May 16, 12:11 am, c <consili...@gmail.com> wrote:
> I'm retrieving webSocketDebuggerUrl fromhttp://localhost:9222/jsonand

c

unread,
May 16, 2011, 11:13:20 PM5/16/11
to google-chrome-...@googlegroups.com
That's just what I was looking for.  Thanks for the detailed response.

consiliens

unread,
May 28, 2011, 10:06:18 PM5/28/11
to google-chrome-...@googlegroups.com
On 05/16/2011 07:17 AM, Peter Rybin wrote:
> You also could try running the whole library -- starting from
> WipBrowserFactory class (seehttp://code.google.com/p/chromedevtools/wiki/HowToBuild

> ). Note that the implementation is rather incomplete by now.
>
> Feel free to ask me if you have some questions about the sources.
>

I modified tests/system/Main.java to use the WIP DEBUGGING protocol as
it's currently hard coded to use SHELL. Loading testwebsite/main.html
in Chrome then running Main.java worked and printed "Test passed OK".

I'd like to programmatically navigate to a URL and listen to network
events. Is this possible using the current WIP API?

consiliens

unread,
May 30, 2011, 8:01:40 PM5/30/11
to google-chrome-...@googlegroups.com
On 05/28/2011 08:06 PM, consiliens wrote:
>
> I'd like to programmatically navigate to a URL and listen to network
> events. Is this possible using the current WIP API?

I found the Java code for Page.open in OpenParams.java. How do I use
OpenParams from tests/system/Main.java?

consiliens

unread,
May 30, 2011, 10:36:18 PM5/30/11
to google-chrome-...@googlegroups.com
On 05/30/2011 06:01 PM, consiliens wrote:
> I found the Java code for Page.open in OpenParams.java. How do I use
> OpenParams from tests/system/Main.java?

The following works, although it isn't pretty. I had to modify the
visibility of getCommandProcessor and send. What's the proper way to
accomplish command sending?

WipTabImpl tab = (WipTabImpl)
firstTab.attach(stateManager.getTabListener());

WipCommandProcessor cmds = tab.getCommandProcessor();

cmds.send(new OpenParams("http://www.google.com/", false), null, null);

Reply all
Reply to author
Forward
0 new messages