Issue metadata
Sign in to add a comment
|
Remote DevTools API crash on Debugger.setScriptSource after Debugger.scriptParsed event
Reported by
justi...@gmail.com,
Sep 12 2017
|
||||||||||||||||||||||
Issue descriptionChrome Version : 62.0.3202.9 What steps will reproduce the problem? 1. Run the attached PoC, which calls setScriptSource inside a scriptParsed event handler after the debugger is paused. I recognize the PoC is not checking that the debugger is successfully paused before attempting to replace the script source; to be honest I'm not completely sure of the semantics of Debugger.paused, Debugger.scriptParsed, and when those events are fired. For context, I'm attempting to instrument JS as script contexts are created. What is the expected result? The script source should be replaced, and hopefully execute when the debugger is resumed. What happens instead of that? The page crashes.
,
Sep 14 2017
@justiczm - have you looked at our protocol documentation? https://chromedevtools.github.io/devtools-protocol/tot/Debugger/ @kozy - not sure if this is really a bug, but do you have any pointers for the person?
,
Sep 21 2017
We're working on new LiveEdit implementation which will fix crash that you are observing. Current implementation of LiveEdit is not reliable. In general you have following options: - run some JavaScript before any JavaScript on the page: Page.addScriptToEvaluateOnNewDocument [1] - can break (you'll get Debugger.paused event) on each new script (excluding evaluated with eval scripts): DOMDebugger.setInstrumentationBreakpoint with scriptFirstStatement. We definitely should introduce enum for this method and make it fires on script evaluated from JavaScript runtime. [1] https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-addScriptToEvaluateOnLoad
,
Sep 22 2017
Ah, DOMDebugger.setInstrumentationBreakpoint looks perfect! Thanks for the reply, I really appreciate it.
,
Oct 12 2017
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by skyos...@chromium.org
, Sep 12 2017