Capturing page JS errors and ignoring them to prevent polluting stdout

Capturing page JS errors and ignoring them to prevent polluting stdout, which otherwise results in the creation of invalid image files when streaming as both the JS page errors and the base64 image are written to stdout.