ChromeDevTools / devtools-protocol

Chrome DevTools Protocol
https://chromedevtools.github.io/devtools-protocol/
BSD 3-Clause "New" or "Revised" License
1.15k stars 226 forks source link

Catching errors from Page.addScriptToEvaluateOnNewDocument #124

Closed SidneyNemzer closed 4 years ago

SidneyNemzer commented 6 years ago

What's the best way to receive errors from a script run with Page.addScriptToEvaluateOnNewDocument? Runtime.exceptionThrown creates events for any exception and the arguments from Runtime.exceptionThrown don't match up with anything from Page.addScriptToEvaluateOnNewDocument, so it doesn't seem possible to tell if the error came from that 'new document' script.

I noticed that the ExceptionDetails from the 'new document' script does not a scriptId, although I doubt that's a reliable way to detect if it came from the 'new document' script. And it wouldn't help differentiate between errors from multiple 'new document' scripts.

Is there something I'm missing, or is this a feature that could potentially be supported by the devtools protocol?

TimvdLippe commented 4 years ago

This repository is related to Chrome DevTools Protocol, but does not track issues regarding its definition or implementation. If you want to file an issue for the Chrome DevTools Protocol, please open an issue on https://crbug.com under component: Platform>DevTools>Platform. Thanks in advance!