Welcome Guest Search | Active Topics | Sign In | Register

Handling Page Unresponsive situation Options
Christian Porzio
Posted: Monday, December 12, 2016 3:43:29 PM
Rank: Advanced Member
Groups: Member

Joined: 10/4/2016
Posts: 104
Hi,

We have a page that when executed in Chrome triggers from time to time a popup:


Page Unresponsive
The following page has become unresponsive. You can
wait for it to become responsive or kill it.


We know this is due to some javaScript errors and we are working on it to fix it there but I suspect when that page is executed in an EO WebView and the same thing happens, the page is killed with no opportunity to actually wait like Chrome offers. In any cases, I never see that popup and my page closes from time to time with no apparent reason.

So my question is: Is this possible to reproduce the same popup, maybe by intercepting the Unresponsiveness situation but I have not see any even handler that would match this situation.

I have implemented the LoadFailed, handler but that's not it.

I have also implemented the Closing handler but it does not even get called, only the Closed handler is called directly without my code having given an opportunity to allow that page closing.

As always thank you for your input on that matter.

Regards
eo_support
Posted: Monday, December 12, 2016 4:00:16 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Christian Porzio
Posted: Monday, December 12, 2016 4:10:58 PM
Rank: Advanced Member
Groups: Member

Joined: 10/4/2016
Posts: 104
Dugh!!! I did not see that one... My apologize, I will implement it and I am sure this is it.

Thank you very much!
Christian Porzio
Posted: Monday, April 10, 2017 6:14:18 PM
Rank: Advanced Member
Groups: Member

Joined: 10/4/2016
Posts: 104
Hi,

Allow me to re-open this topic as we are running again into this same situation. There is definitely something wrong on the web page and they will try to work on this but basically I have implemented the handler as follow:

Code: C#
private void webView_RenderUnresponsive(object sender, RenderUnresponsiveEventArgs e)
        {
            TraceConsoleViewer("Page Unresponsive: [" + e.JavaScriptStackTrace + "]");
            MessageBoxResult res = MessageBox.Show("The web page has become unresponsive.\n"+e.JavaScriptStackTrace+"\n\nDo you want to close it now? (if no, you application may become unstable)", "Page is unresponsive", MessageBoxButton.YesNo, MessageBoxImage.Warning,MessageBoxResult.No);
            if (res == MessageBoxResult.Yes)
            {
                CloseMe();
            }
        }


I do get my popup with some stack trace but even if I chose to continue, it will never recover. The popup will come again a few time until eventually the worker thread itself dies.

The situation with chrome native is slightly different, we get the popup kill or wait, but if one does not answer, the popup eventually disappears by itself and the page become responsive again. I was able to recover the same way with Chrome native v54.

So I do realize that at this point, things become quite unpredictable and that I might just be lucky that Chrome recovers, but I was wondering if there is anything better than I can do when handling this event?

For instance, is there a way to find out the webView is no longer unresponsive? It looks like Chrome native has a way to find out when it becomes responsive again.

I apologize to use your expertise to work around what looks like a wrong design on the javascript side, but my users are kind of expecting the same outcome on this dedicated browser as with Chrome.

So any suggestion will be very welcome!

Thank you many in advance.

Regards
eo_support
Posted: Monday, April 10, 2017 6:35:22 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

You can try to call QueueScriptCall in a timer and if you get back right away then somehow the JavaScript code in the page has recovered and your render is responsive. If not then the render is still busy. Make sure you don't call QueueScriptCall again until the previous one is done -- otherwise you would be flooding the render even more and make a bad situation worse.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.