Open Skarnivorous opened 3 years ago
Hey @Skarnivorous - being blocked on local resource access for 10-20 sounds suspiciously like an antivirus is running a scan or something similar. I'll change this to a bug on our backlog and we'll see if we can reproduce the behavior with local content. I'm glad you have a workaround though :)
Thanks - I am quite happy with the performance/response after mapping the virtual host name - but it is a little 'unexplained' behaviour so I just wanted to have it logged here and how I worked around it for anyone else to reference if they find similar situation.
For reference - for a local folder index.html source in the webview2 control. The img sources were coded something like:
The network requests for img source would sit in 'Pending' for a long time, and then all calls for resources after about 10-20 seconds would load fine.
The resolution was to immediately map a virtual host name to the local folder after EnsureCoreWebView2Async and use proper address source.
The pending network status no longer occurs and images load immediately. I assume some initial handshake/connection for the control to the actual local folder path was taking some time. Whether this is a bug or not, I can't be sure - it is likely better practice to set up the virtual host name anyway.
AB#32524620