Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get a `callFrameID` to pass to `Debugger.evaluateOnCallFrame`?

WebKit's Remote Debugging Protocol went 1.0 recently and I've been playing around with it a little, mostly out of curiosity and interest. I've thrown together a very basic recreation of Chrome's developer tools console as a replacement front-end, but I'm a little confused as to how I can execute code in a specific frame/window like Chrome's Dev Tools allow you to.

At the moment, I'm using the Runtime.evaluate method to execute my console input. This seems inadequate because of the aforementioned problem and it doesn't provide the command line API. I've discovered the Debugger.evaluateOnCallFrame method, which requires a callFrameID parameter. The only problem is, it doesn't seem possible to remotely acquire a list of callFrame objects to pass to this method.

I have a feeling I'm completely missing something here. Does anyone know the solution?

like image 214
Andy E Avatar asked Oct 22 '25 02:10

Andy E


1 Answers

Have a look at the Debugger.paused event, which will give you an array of current call frames.

like image 119
Alexander Pavlov Avatar answered Oct 26 '25 17:10

Alexander Pavlov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!