Back Issue OnLoadError rendering with LoadUrl best approach?

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

Back Issue OnLoadError rendering with LoadUrl best approach?

Postby mitchc » Mon Dec 09, 2019 11:51 am

With recent changes using LoadString for error handling was ruled a bad idea:
https://bitbucket.org/chromiumembedded/ ... ce-and-get
https://bitbucket.org/chromiumembedded/ ... imple-when
https://bitbucket.org/chromiumembedded/ ... -makes-the

and was removed in newer commits all together.

LoadUrl with a base64 encoded error message seemed like a good stop gap for displaying OnLoadError messages to the user.

The problem with this is is LoadUrl adds a new navigation entry to history as well. When this is mixed with the fact there is only GoBack/GoForward short of walking the history tree then manually navigating back to the entry from two before there is not a great way to support the back button properly.

Currently assuming a non temporal error OnLoadError is called when visiting errorsite.com this then leads to LoadUrl being called with the error message causing bath in the history stack. Hitting back navigates again to errorsite.com which immediately would cause OnLoadError to trigger resulting in the user being stuck.

A work around is to detect on an error page and inject javascript of history.go(-2) on back request which works but is clumsy to a degree.

The cleanest options would seem:
1) Rendering an error page outside of the browser itself
2) On option to not add (or to remove) entries from the navigation history, so back works as expected
3) To intercept the error earlier in the chain and return custom text for the page as is bypassing OnLoadError.
mitchc
Newbie
 
Posts: 3
Joined: Wed Apr 25, 2018 4:26 pm

Re: Back Issue OnLoadError rendering with LoadUrl best appro

Postby mitchc » Mon Dec 09, 2019 12:39 pm

The LoadUrl is used by the sample client for example:
https://bitbucket.org/chromiumembedded/ ... ler.cc-149

so it is subject to the same issue (browser to a invalid domain for example and try to go back).
mitchc
Newbie
 
Posts: 3
Joined: Wed Apr 25, 2018 4:26 pm

Re: Back Issue OnLoadError rendering with LoadUrl best appro

Postby magreenblatt » Mon Dec 09, 2019 1:06 pm

You raise valid points. See the comment at https://bitbucket.org/chromiumembedded/ ... t-52020179
magreenblatt
Site Admin
 
Posts: 9974
Joined: Fri May 29, 2009 6:57 pm


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 5 guests