|
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?
|
|
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.aspxThanks
|
|
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?
|
|
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.aspxThis 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!
|
|
Rank: Newbie Groups: Member
Joined: 10/25/2019 Posts: 4
|
Great! I will try to do this, thanks for pointing!
|
|
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.
|
|
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.
|
|