Home CefSharp ChromiumWebBrowser.Load fails on some URLs
Reply: 0

CefSharp ChromiumWebBrowser.Load fails on some URLs

Michael Joseph Boudreau-Cervon
1#
Michael Joseph Boudreau-Cervon Published in 2017-12-08 01:12:05Z

I've built an WinForms app that uses the CefSharp package to render sites using Chrome. It works perfect, almost. When I ask it to navigate to one of our internal URLs, it doesn't navigate at all. I can send it to any other site I wish, internal or external to our network. I've tried using the URI class to reformat the URL string, using HTML code in a site to redirect to the desired URL, using a hyperlink on a site to link to the URL, doing HTTP or HTTPS, and ending the URL with and without a backslash.

All the googling in the world says this should not be happening using the most recent version of CefSharp. I've ruled out the issue being the browser not being initialized, as I can navigate to other sites, and it fails 100% of the time I try to navigate to the desired URL. I've ran out of ideas. I can load the site using Firefox or Chrome outside of the application without an issue, and I can use IE but with compatibility mode disabled (ruling out the webbrowser control in .NET).

I'm looking for a way to "force" the browser to navigate to the URL.

public void changeUrl(string url)
        {
            try
            {
                Uri address = new Uri(url);
                url = address.AbsoluteUri;
            }catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
            Control ctrl = getBrowser();
            if(ctrl is WebBrowser)
            {
                WebBrowser ie = (WebBrowser)ctrl;
                ie.Navigate(url);
            }
            else
            {
                ChromiumWebBrowser chrome = (ChromiumWebBrowser)ctrl;
                chrome.Load(url);
            }
        }
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.322374 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO