WebView.LongRunningScriptDetected WebView.LongRunningScriptDetected WebView.LongRunningScriptDetected WebView.LongRunningScriptDetected Event

Definition

Occurs periodically while the WebView executes JavaScript, letting you halt the script.

public : event TypedEventHandler LongRunningScriptDetected<WebView, WebViewLongRunningScriptDetectedEventArgs>
// Register
event_token LongRunningScriptDetected(TypedEventHandler<WebView, WebViewLongRunningScriptDetectedEventArgs> const& handler) const;

// Revoke with event_token
void LongRunningScriptDetected(event_token const& cookie) const;

// Revoke with event_revoker
LongRunningScriptDetected_revoker LongRunningScriptDetected(auto_revoker_t, TypedEventHandler<WebView, WebViewLongRunningScriptDetectedEventArgs> const& handler) const;
public event TypedEventHandler LongRunningScriptDetected<WebView, WebViewLongRunningScriptDetectedEventArgs>
Public Event TypedEventHandler LongRunningScriptDetected(Of WebView, WebViewLongRunningScriptDetectedEventArgs)
<WebView LongRunningScriptDetected="eventhandler"/>

Remarks

Your app might appear unresponsive while scripts are running. This event provides an opportunity to interrupt a long-running script. To determine how long the script has been running, check the ExecutionTime property of the WebViewLongRunningScriptDetectedEventArgs object. To halt the script, set the event args StopPageScriptExecution property to true. The halted script will not execute again unless it is reloaded during a subsequent WebView navigation.

Note

In some cases, the WebView cannot detect a long-running script. For example, this event might not occur if the script is stuck in a loop that doesn’t perform any memory allocations.

See Also