WebView2.ExecuteScriptAsync(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Asynchronously executes the provided script in the top level document of the WebView2.
This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).
public:
virtual IAsyncOperation<Platform::String ^> ^ ExecuteScriptAsync(Platform::String ^ javascriptCode) = ExecuteScriptAsync;
IAsyncOperation<winrt::hstring> ExecuteScriptAsync(winrt::hstring const& javascriptCode);
public IAsyncOperation<string> ExecuteScriptAsync(string javascriptCode);
Public Function ExecuteScriptAsync (javascriptCode As String) As IAsyncOperation(Of String)
Parameters
- javascriptCode
-
String
Platform::String
winrt::hstring
The script to execute.
Returns
A Task that represents the script execution process.