This recipe introduces the
onConsoleMessage callback, discusses how to intercept debugger messages on the web page, and forwards them to the command-line output. The
onConsoleMessage demonstration serves as an introduction to the other callbacks (for example,
onResourceReceived, and so on) that can be attached to
webpage instances, while also providing a frame of reference for working with them.
The script in this recipe is available in the downloadable code repository as