Generic Windows Phone 8.1 app crashes while scrolling in WebView

I am trying to load html content from string using WebView.NavigateToString. The page loads fine, but when I scroll before loading the content, the app crashes. The debugger in Visual Studio 2013 does not detect the crash, instead it says the application exited fine. The memory usage in the application is also low at around 50MB.

This is the code I used to navigate to the page using the WebViewer.

MainPage.cs

public MainPage()
    {
        this.InitializeComponent();

        this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Required;
    }


    private void article1_Click(object sender, RoutedEventArgs e)
    {
        Frame.Navigate(typeof(webviewpage),"<!doctype html><html><head><style>img {display: block;margin-left: auto;margin-right: auto;margin-top: 20px; margin-bottom: 20px; width: 100%; height: auto} li { font-size: 2em; } ul { font-size: 25px; } iframe { width: 950; height: 720; display: block;margin-left: auto;margin-right: auto} blockquote { font-size: 3em; font-style:italic; }</style></head><body><p><b>[Vídeo] Os melhores jogos gratuitos para Windows Phone #3</b></p><p style=\"text-align: justify;\">Hoje temos mais uma vez uma dica de 5 games gratuitos para Windows Phone. Se o seu jogo favorito não aparecer nesta seleção, confira os <a href=\"http://www.wpmania.com.br/2014/06/26/video-5-jogos-gratuitos-estilo-plataforma-01/\" target=\"_blank\">outros vídeos</a> pois ele pode estar lá e, caso não esteja, deixe o nome dele nos comentários para que o nosso parceiro Marcos possa fazer o vídeo com a dica para os demais leitores!</p><p style=\"text-align: justify;\"><strong>Sem mais delongas, confira o vídeo abaixo: </strong></p><p><iframe src=\"https://www.youtube.com/embed/rDiL8Z_nz0k\" width=\"640\" height=\"360\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"></iframe></p></body></html>");            
    }

      

webviewpage.cs

public webviewpage()
    {
        this.InitializeComponent();
    }

    protected override void OnNavigatedTo(NavigationEventArgs e)
    {
        browser.NavigateToString(e.Parameter.ToString());
    }

      

webviewpage.xaml

<Page
x:Class="App2.webviewpage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App2"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

<Grid>
    <WebView Name="browser"></WebView>
</Grid>

      

The complete solution can be downloaded here: http://speedy.sh/aedfb/App2.rar . When bypassing the emulator, compared to a real device, the application crashes less often (Lumia 520 in my case). Select an article in the article and scroll down as fast as you can and the app will crash.

My question is what is causing the application to crash, or does anyone know how I can debug the crash? Even if the html does not contain images or iframes, it still crashes.

+3


source to share


1 answer


Apparently, a bug in Windows Phone 8.1 reports version 8.10.14176.xx.



For a full discussion, please refer to: http://social.msdn.microsoft.com/Forums/windowsapps/en-US/854abfa2-5312-4583-92d9-26430c7f5d9c/universal-app-webview-crashing-when-scrolling -windows-phone-81? forum = wpdevelop # 2344d0b6-f32c-4ff7-b0a5-b41d04c26e2c

+1


source







All Articles