Welcome Guest Search | Active Topics | Sign In | Register

WebView, ThreadRunner, WebControl Options
mpalatik
Posted: Friday, October 25, 2019 4:37:29 AM
Rank: Newbie
Groups: Member

Joined: 10/25/2019
Posts: 4
Is it safe to associate WebView, created via ThreadRunner`s CreateWebView method with a WebControl component?

Update: There`s an exception thrown when trying to do so, so obviously that`s not safe. Is it at all possible? To load a page without UI and display it later?
eo_support
Posted: Friday, October 25, 2019 10:39:18 AM
Rank: Administration
Groups: Administration

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

The WebView class is thread specific so you can not create it in one thread and use it in another thread. If you must preload a page before displaying it, you can use this method:

https://www.essentialobjects.com/doc/eo.webbrowser.webview.preload_overloads.aspx

Thanks
mpalatik
Posted: Friday, October 25, 2019 11:16:07 AM
Rank: Newbie
Groups: Member

Joined: 10/25/2019
Posts: 4
Thanks for the answer! Is it possible to install custom ResourceHandler to a WebView that is created with this method before the PreloadTask start?
eo_support
Posted: Friday, October 25, 2019 3:30:44 PM
Rank: Administration
Groups: Administration

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

You can try to use this version:

https://www.essentialobjects.com/doc/eo.webbrowser.webview.preload_overload_1.aspx

This version has a doneCallback argument. What you can do is to pass an useless Url to the url argument, and then call webView.LoadUrlAndWait to load the actual Url inside your doneCallback function. Note that when you do this, the PreloadTask's NavigationTask property will point to the navigation task of the initial useless Url. So make sure you do not use that property.

Thanks!
mpalatik
Posted: Friday, October 25, 2019 3:33:58 PM
Rank: Newbie
Groups: Member

Joined: 10/25/2019
Posts: 4
Great! I will try to do this, thanks for pointing!
mpalatik
Posted: Saturday, October 26, 2019 3:18:13 PM
Rank: Newbie
Groups: Member

Joined: 10/25/2019
Posts: 4
Almost perfect solution but one thing could be added to it - possibility to specify Engine in a WebView.Preload call.
eo_support
Posted: Tuesday, October 29, 2019 9:41:02 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Thanks for the feedback. We will look into this and see what we can do.


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.