|
Rank: Member Groups: Member
Joined: 6/16/2014 Posts: 25
|
Hi, In my code I create a new WebView and immediately load HTML Code into the Webview with LoadHtml(). It seems that this causes CanGoBack to be 'true'. If I load a url as the first content, CanGoBack keeps the value 'false'. If I go back after LoadHtml, the new url is a empty string.
regards, Michael
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
This is due to the fact that the web engine must first be initialized with a Url. LoadHtml is somehow similar to setting body.outerHTML, so it won't function without first having a body element first. Because of this, internally the WebView will always call LoadUrl("about:blank") first. If you issue another LoadUrl immediately, then the initial LoadUrl("about:blank") call is canceled thus your Url became the first entry in the history. However if you call LoadHtml, then it must first wait the initial LoadUrl("about:blank") to finish. This causes "about:blank" to be the first entry in the history. If this is an issue, you can do:
1. Manage the history yourself. This way you will have full control over what appears in the history;
-- OR --
2. Use Data Url. You can encode the whole HTML as a data Url and then pass that data Url to LoadUrl. You can use this method to load small HTML snippet since there might be length limits on the Url;
Hope this helps. Please feel free to let us know if you still have any questions.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 6/16/2014 Posts: 25
|
Hi, thank you for the tip with the data url. This works well!
Beside this, how can I manage the history myself?
Best regards, Michael
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
By managing history yourself, I meant you would keep a list of history items in your own code, then instead of using GoBack/CanGoBack, you can check your own history item and call LoadUrl instead.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 6/16/2014 Posts: 25
|
Ok. It seems that the youtube fullscreen is still not working. Is there any chance, that this will work in the near future?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
That is not supported yet. It probably will not be added in the near future, but I am hoping that it to be added this year.
Thanks!
|
|