WebView2.ExecuteScriptAsync(String) Method

Definition

Asynchronously executes the provided script in the top level document of the WebView2.

public:
 virtual IAsyncOperation<Platform::String ^> ^ ExecuteScriptAsync(Platform::String ^ javascriptCode) = ExecuteScriptAsync;
IAsyncOperation<winrt::hstring> ExecuteScriptAsync(winrt::hstring const& javascriptCode);
public IAsyncOperation<string> ExecuteScriptAsync(string javascriptCode);
function executeScriptAsync(javascriptCode)
Public Function ExecuteScriptAsync (javascriptCode As String) As IAsyncOperation(Of String)

Parameters

javascriptCode
String

The script to execute.

Returns

IAsyncOperation<String>

A Task that represents the script execution process.

Applies to