We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trying to update some legacy code with WebView2 and can't find an equivalent property for System.Windows.Forms.WebBrowser.Document, https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.webbrowser.document?view=windowsdesktop-6.0
WebView2
System.Windows.Forms.WebBrowser.Document
is there a property that supports this functionality off the base object and or CoreWebView2?
The text was updated successfully, but these errors were encountered:
Hey @jwilburn - WebView2 doesn't give direct access to DOM elements. Instead you should use ExecuteScriptAsync to run script that manipulates the DOM as you need it. More info on native <-> web interop is here: https://docs.microsoft.com/en-us/microsoft-edge/webview2/how-to/communicate-btwn-web-native
ExecuteScriptAsync
We are tracking adding support for HTML/DOM access here: MicrosoftEdge/WebView2Feedback#77
Thanks!
Sorry, something went wrong.
Hey @champnic, I don't need to manipulate the DOM, I just access to a property that would return the entire HTML document. Is that available?
You should be able to do something like var html = ExecuteScriptAsync("document.body.innerHTML;");.
var html = ExecuteScriptAsync("document.body.innerHTML;");
No branches or pull requests
trying to update some legacy code with
WebView2
and can't find an equivalent property forSystem.Windows.Forms.WebBrowser.Document
, https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.webbrowser.document?view=windowsdesktop-6.0is there a property that supports this functionality off the base object and or CoreWebView2?
The text was updated successfully, but these errors were encountered: