Forum General

WebView is not loading page

HemersonVarelaHemersonVarela USMember
edited February 6 in General

I have this very simple app

At mainPage.xaml file (just a WebView)

       <WebView x:Name="Browser"
           WidthRequest="1000" />

At .cs file

   public MainPage()
       NavigationPage.SetHasNavigationBar(this, false);
       Browser.Source = "";

but I noted that the web view page is not able to load links from the domain (note that the protocol is https) other link work fine

On the console I can see below longs:

[ProcessSwapping] 0x1181de198 - ProvisionalPageProxy::ProvisionalPageProxy: pageID = 14 navigationID = 6 suspendedPage: 0x0
[ProcessSwapping] 0x1181de198 - ProvisionalPageProxy::didFailProvisionalLoadForFrame: pageID = 14, frameID = 1, navigationID = 6
[ProcessSuspension] 0x11815f840 - ProcessAssertion::processAssertionWasInvalidated()

Is there any way I can display links from domain on a WebView?


  • soufianemarlysoufianemarly Member ✭✭

    try this

    in your Xaml

        <WebView x:Name="Browser" HorizontalOptions="Fill" VerticalOptions="Fill"  />

    in your cs

                var htmlSource = new HtmlWebViewSource();
                htmlSource.Html = app.Properties["cgu"].ToString();  //.  something like \n<p><strong>GPU</strong>\n<br
                    Browser.Source = htmlSource;

    hope this works for you

Sign In or Register to comment.