I have a windows c# application that uses WebBrowser Control to navigate to a webpage. I use WebBrowser.Print() to silent print this web page. Now i get some Java Script errors while printing. Is it possible to suppress these.
webBrowser1.ScriptErrorsSuppressed = true; doesnt seem to work as these errors occur only when printing the webpage.
Thanks,
Rajee
I don’t know about c# actually, but generally speaking web browsers report errors into the console only when the error event has bubbled up the DOM all the way up to the
windowwhile not being handled on its way up. If you bind a Javascript handler to"error"and prevent its further propagation, it then won’t reach the document-bound default handler and supress all further errors from being reported into the console.This is the simplest Javascript example: