Questions icon indicating copy to clipboard operation
Questions copied to clipboard

Is it possible to load XML contents in WebView2 (instead of WebBrowser) ?

Open RatheeshVA opened this issue 2 years ago • 0 comments

I want to upgrade the browser from WebBrowser to WebView2 in our existing application (written in Visual C++).

Using WebBrowser, I normally loaded images in a tabular format (arranged by defining in XSL). Also I could able to do operations(like Image drag and drop) within this table using JS(with DOM architecture).

By upgrading to WebView2, I want to able to do the same operations as above(In WebBrowser).

I just tried below things,

  1. Created instance of ICoreWebView2.
  2. Invoked ICoreWebView2->Navigate(url) Here I passed local path of XML file as url parameter. I tried adding the below code before CreateCoreWebView2EnvironmentWithOptions() function call, options->put_AdditionalBrowserArguments(L"--allow-file-access-from-files")

I want to provide the same support using WebView2 by replacing WebBrowser. Anybody please provide suggestions, is this possible to do ?

RatheeshVA avatar Sep 28 '23 07:09 RatheeshVA