javascript error with WebBrowser

1

I'm creating an application with WebBrowser component in C # but when I run the following code it returns me a JavaScript error and does not run my other application that was developed in Adobe Flex:

private void chamaPagina(string tipo)
{
    string url = "";
    string pac = "http://localhost/accelerated_pac_base.pac";

    if (tipo == "frete")
    {
        url = "http://localhost/frete.html#";
    }
    else
    {
        url = "http://localhost/posto.html#";
    }

    //Método externo para ler arquivo pac e configurar proxy
    WebRequest requestNavegador = (HttpWebRequest)WebRequest.Create(url);

    string dadosProxy = Proxy.GetProxyForUrlUsingPac(url, pac);

    if (dadosProxy != null)
    {
        requestNavegador.Proxy = new WebProxy(dadosProxy);
    }

    HttpWebResponse response = (HttpWebResponse)requestNavegador.GetResponse();
    Stream receiveStream = response.GetResponseStream();

    webBrowser1.DocumentStream = receiveStream;
}

But if I add webBrowser1.ScriptErrorsSuppressed = true; it did not display the error messages and still does not run my application in Adobe FLEX.

    
asked by anonymous 04.08.2014 / 14:48

1 answer

0

The error occurs because the browser engine it uses is Ie and some java script functions do not run on Ie, what happened is that you just did not let the error appear but it is there, I suggest using a try so the error happens but your application continues.

    
05.08.2014 / 20:47