hi! can I upload my html code to the specified url? In the temple, I achieved this in this way:
Form1.Chromium1.Browser.MainFrame.LoadString('<HTML>', 'https://musite.com');
I tried to do WVBrowser1.NavigateToString(str); but it loads the page on about:blank
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
html code on the selected url
- salvadordf
- Posts: 4563
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: html code on the selected url
The WebView2 API only allows you to call TWVBrowserBase.NavigateToString with one parameter for the HTML contents.
https://docs.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.1185.39#navigatetostring
https://docs.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.1185.39#navigatetostring
WebView2 doesn't allow you to specify the origin URL in this case.Initiates a navigation to htmlContent as source HTML of a new document.
public HRESULT NavigateToString(LPCWSTR htmlContent)
The htmlContent parameter may not be larger than 2 MB (2 * 1024 * 1024 bytes) in total size. The origin of the new page is about:blank.