Welcome Guest Search | Active Topics | Sign In | Register

[Web Browser]Detect/customize Blank page Options
Eurice
Posted: Monday, July 25, 2016 7:01:26 AM
Rank: Advanced Member
Groups: Member

Joined: 12/10/2014
Posts: 133
Hello EO team,

We are still facing some webview crash / not loading resulting in a blank page (starting with <!-- EO blank -->)

Is there any way we could list to an event to know when those page are displayed ?

OR


Personnalize them with a message like "Something went wrong, reload?" with a button that could trigger c# code ?

Thanks,


best regards

eo_support
Posted: Monday, July 25, 2016 10:42:23 AM
Rank: Administration
Groups: Administration

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

If you see, "<EO blank>", then the WebView has not crashed. If you believe it should not display that, please try to isolate the problem into a test project and then send the test project to us.

If you wish to display custom message when the WebView has crashed, you can handle WebView.Closed event and then check the event argument's Reason property to see if it is "Normal". If it is not "Normal", then it's a crash and then you can display some custom message to the end user.

Thanks!
doots
Posted: Wednesday, July 27, 2016 11:30:51 AM
Rank: Newbie
Groups: Member

Joined: 4/5/2016
Posts: 1
Hi,

My team experiences the same issues. Instead of showing EO Blank, it would be helpful to trigger a reload potentially so the user can get out of this state? If you have any other ideas for us to try, please let us know. This occurs fairly often and we have multiple instances of EO running.

Thank you.
eo_support
Posted: Wednesday, July 27, 2016 12:15:24 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,201
doots wrote:
Hi,

My team experiences the same issues. Instead of showing EO Blank, it would be helpful to trigger a reload potentially so the user can get out of this state? If you have any other ideas for us to try, please let us know. This occurs fairly often and we have multiple instances of EO running.

Thank you.


Hi,

There are two different scenarios. <!-- EO blank --> and WebView crashes. They both look exactly the same but they are different. We can not replace <!-- EO blank --> with a custom page since that page serves a special purpose. If that page does not go away, then something in the engine is wrong and just replacing that page will not fix the problem for you. So you will need to find out exactly which case it is first.

Thanks!
Eurice
Posted: Friday, July 29, 2016 3:29:04 AM
Rank: Advanced Member
Groups: Member

Joined: 12/10/2014
Posts: 133
Yes I noticed that,
sometimes the page is just blank with no url loaded
sometimes the page is blank and all new webview will be blank too until we restart webCore
JK
Posted: Thursday, August 4, 2016 9:40:02 AM
Rank: Advanced Member
Groups: Member

Joined: 7/20/2015
Posts: 52
Same issue here using 16.1.54, WPF. My app has several WebViews, all are loaded on the Main thread using LoadUrl method. Sporadically, 1 or 2 of them display EO.Blank. I have put logging in place to confirm that after the NavigationTask is done, the Url property of WebView is what I expect it to be. Something happens to the WebView internally because in a subsequent operation, I can see that Url is back to being an empty string. I am calling LoadUrl after WebControl has been Loaded. This is very difficult to reproduce and therefore debug.

It's difficult to produce a sample project to exhibit this. Is there any code internally that would set Url back to an empty string?
JK
Posted: Thursday, August 4, 2016 9:48:53 AM
Rank: Advanced Member
Groups: Member

Joined: 7/20/2015
Posts: 52
Also want to note that I don't think the WebView has crashed since I can right-click on the white area and get the context menu to view source. Also, no exception is logged and I am handling EO exceptions. Should I be looking at the Closed event and then reacting to it? Please advise.
Eurice
Posted: Friday, August 5, 2016 5:03:44 AM
Rank: Advanced Member
Groups: Member

Joined: 12/10/2014
Posts: 133
JK wrote:
Same issue here using 16.1.54, WPF. My app has several WebViews, all are loaded on the Main thread using LoadUrl method. Sporadically, 1 or 2 of them display EO.Blank. I have put logging in place to confirm that after the NavigationTask is done, the Url property of WebView is what I expect it to be. Something happens to the WebView internally because in a subsequent operation, I can see that Url is back to being an empty string. I am calling LoadUrl after WebControl has been Loaded. This is very difficult to reproduce and therefore debug.

It's difficult to produce a sample project to exhibit this. Is there any code internally that would set Url back to an empty string?



You described the problem we face perfectly : /

Btw, we are loading/setting url 2-3 webviews at the same time
eo_support
Posted: Friday, August 5, 2016 4:31:46 PM
Rank: Administration
Groups: Administration

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

The code does internally set it to blank Url however that is the "initializing Url". That Url will not be loaded if another Url is submitted. We are not able to reproduce the problem here so we can't go much further. We will update this thread again if we managed to catch it.

Thanks!
JK
Posted: Thursday, September 22, 2016 9:51:21 AM
Rank: Advanced Member
Groups: Member

Joined: 7/20/2015
Posts: 52
Hi EO Support!

This issue didn't go away (we are upgraded to 16.2.1 at this point), but I recently found a workaround that may provide a clue to you.

First, the facts:
1.) After calling WebView.LoadUrl NavigationTask is completely successful
2.) WebView and EO Runtime are still fully functional

Regardless, we still sometimes see the EO.Blank page instead of our desired page. Very frustrating because it's not easily reproducible.

Now, I have put some code in place that ensures a few things before I ever call WebView.LoadUrl. This seems to work (for now). Without these checks, we sporadically get EO.Blank:
1.) The control containing WebControl IsLoaded
2.) The WebControl IsLoaded
3.) The WebView StatusMessage is not null
4.) The WebView IsCreated

It would be awesome if there was a "IsReadyToLoadUrl" property and "IsReadyToLoadUrlChanged" event on WebView.

Additionally, I have proven that sometimes our desired page loads and then goes backward to EO.Blank after the user starts using it. We've proven that backspace key can cause this but it also happens inexplicably sometimes. So, I've added some javascript to JsInitCode that checks whether the page is blank (url starts with data:text) every 2 seconds and fires extInvoke, which calls LoadUrl again on the C# side. It's a hack but it should reduce the support calls hopefully:

var lastValidUrl;
window.onload = function () {
document.onkeydown = function(event) {
backspaceIsPressed = event.which == 8;
};
document.onkeyup = function(event) {
backspaceIsPressed = false;
};
window.onbeforeunload = function(e) {
if(backspaceIsPressed) {
var dialogText = 'Are you sure you want to leave this page?';
e.returnValue = dialogText;
return dialogText;
}
};

setInterval(function() {
if(window.location.href.startsWith('data:text') && lastValidUrl) {
eoWebBrowser.extInvoke('BlankScreenDetected', arguments);
} else {
lastValidUrl = window.location.href;
}
}, 2000);
};
eo_support
Posted: Thursday, September 22, 2016 1:53:19 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,201
Thanks for sharing. By design the WebView will always load a blank Url (to initialize) before loading the actual Url. However your work around does bring up an interesting point is that if user load an actual Url and then accidently press back key, it will navigate "back" to the initial blank page. This is not desired since the initial blank page is an internal implementation and should not be visible to user. We will look into this and see if we can correct this in our next build.
JK
Posted: Thursday, September 22, 2016 3:17:03 PM
Rank: Advanced Member
Groups: Member

Joined: 7/20/2015
Posts: 52
Great - if you can make it so that the EO.Blank page is never displayed to a user once a real page has been loaded, I think that would likely take care of the problem overall.

Note also that sometimes it goes back to the blank page even when no user interaction has occurred and it truly seems somehow related to those properties I'm checking. Since I've put those checks in, we've had zero"no-user-interaction" blanks. Thanks!
Eurice
Posted: Friday, September 23, 2016 3:19:59 AM
Rank: Advanced Member
Groups: Member

Joined: 12/10/2014
Posts: 133
Hi,

We used a different and simpler workaround that seems to fit our "blank page problem" :

We just listen to webView Closed event and if the reason is an engine crash we reload a new webview

if (e.Reason == WebViewCloseReason.EngineCrash) reloadWebview();

It's not the best because the load is a bit delayed, but it seems to be working great in our case.

Thanks for your informations JK


Regards
JK
Posted: Friday, September 23, 2016 7:47:18 AM
Rank: Advanced Member
Groups: Member

Joined: 7/20/2015
Posts: 52
Hi Eurice,

Thanks for the info! In our case, WebView never closes and the engine never crashes. Still looks like some good defensive code you've got there. I may borrow it!

Regards,

JK
Eurice
Posted: Thursday, September 29, 2016 6:42:03 AM
Rank: Advanced Member
Groups: Member

Joined: 12/10/2014
Posts: 133
Hi JK,

I still face the problem with customer using window 7;
Are you guys using it too ?

Thanks
JK
Posted: Thursday, September 29, 2016 7:37:21 AM
Rank: Advanced Member
Groups: Member

Joined: 7/20/2015
Posts: 52
Yes, Windows 7.


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.