WebBrowser ignore javascript errors

B

bacsumu

In my c# program ive got a WebBrowser control in which a certain
website is called.
This website gives for some reason a javascript errors (message box)
from time to time. Is there a way to build my program so that the
javascript errors dont appear ?

i search many article but i don't solve

i'm try next

private void axWebBrowser1_DocumentComplete(object sender,
AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent e)
{
// excute javascript error
SHDocVw.WebBrowser b = (WebBrowser)e.pDisp;
mshtml.HTMLDocumentClass c =
(HTMLDocumentClass)b.Document;
mshtml.HTMLWindow2Class w =
(HTMLWindow2Class)c.parentWindow;

try
{
w.HTMLWindowEvents2_Event_onerror +=new
HTMLWindowEvents2_onerrorEventHandler(w_HTMLWindowEvents2_Event_onerror);
m_ScriptErrorHandleTable.Add(e.uRL, w);
}
catch(Exception e10)
{
SSTrace.Trace( e10 );
}
}

private void w_HTMLWindowEvents2_Event_onerror(string description,
string url, int line)
{
try
{
HTMLWindow2Class w =
(HTMLWindow2Class)m_ScriptErrorHandleTable; [email protected] = true; } ca...english expression is poor.. understanding me
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top