WebView.InvokeScriptAsync(String, IIterable<String>) WebView.InvokeScriptAsync(String, IIterable<String>) WebView.InvokeScriptAsync(String, IIterable<String>) WebView.InvokeScriptAsync(String, IIterable<String>) Method

Definition

Executes the specified script function from the currently loaded HTML, with specific arguments, as an asynchronous action.

public : IAsyncOperation<Platform::String> InvokeScriptAsync(Platform::String scriptName, IIterable<Platform::String> arguments)
IAsyncOperation<winrt::hstring> InvokeScriptAsync(winrt::hstring scriptName, IIterable<winrt::hstring> arguments) const;
public IAsyncOperation<string> InvokeScriptAsync(String scriptName, IEnumerable<String> arguments)
Public Function InvokeScriptAsync(scriptName As String, arguments As IEnumerable(Of String)) As IAsyncOperation(Of string)
Parameters
scriptName
String String

The name of the script function to invoke.

arguments
IEnumerable<String> IEnumerable<String>

A string array that packages arguments to the script function.

Returns

When this method returns, the string result of the script invocation.

Remarks

To prevent malicious code from exploiting your app, be sure to call this method to invoke only scripts that you trust.

The invoked script can return only string values.

Your app might appear unresponsive while scripts are running. Handle the LongRunningScriptDetected event to interrupt a long-running script.