I want to prevent IE from showing JS error dialogs, I read that it can be done by setting ScriptErrorsSuppressed = true.
Where exactly do I set it in IWebBrowser2?
Thanks
Simply use put_Silent method.
m_pWebBrowser->put_Silent(VARIANT_TRUE);
As mentioned earlier, use the put_Silent()
method to turn error reporting on or off.
For example, if using a CDHtmlDialog
, put this in your OnInitDialog()
:
m_pBrowserApp->put_Silent(VARIANT_TRUE);
and put it before the LoadFromResource()
call.
Be careful though as this will suppress a lot more messages than just JavaScript errors. (Think SSL certificate notifications.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With