J2V8 icon indicating copy to clipboard operation
J2V8 copied to clipboard

How to use V8DebugServer

Open kaolaxiaowugo opened this issue 5 years ago • 2 comments

I want to debug javascript in the chrome and I found V8DebugServer ,but it can't work . plz help me , very pleasure.

V8Object debugScope = runtime.getObject(DEBUG_OBJECT_NAME); debugScope is UNDEFINED , and the next steps get exception.

kaolaxiaowugo avatar Dec 14 '20 10:12 kaolaxiaowugo

Hi, V8DebugServer is not compatible with J2V8 6.2. You have to use V8Inspector instead.

To establish communication with Chrome DevTools, you have to create a WebSocket based HTTP server then forward messages from Chrome DevTools to V8Inspector.dispatchProcotolMessage.

ahmadov avatar Dec 15 '20 11:12 ahmadov

FYI - you can use https://github.com/AlexTrotsenko/j2v8-debugger for this. I wrote a blog post about updating it to use the Inspector protocol. https://engineering.salesforce.com/debugging-embedded-javascript-in-an-android-app-using-chrome-devtools-8553864ee09c

jamie-houston avatar May 13 '21 21:05 jamie-houston