[Android] Timeouting of onShouldStartLoadWithRequest

Author: AiniasCreated Aug 14, 2026Updated Aug 14, 2026
LabelsType: feature request

Is your feature request related to a problem? If so, Please describe.

On slow devices or under heavy load, the registered onShouldStartLoadWithRequest is called, but the return value is ignored, as the whole roundtrip with calling it from the native site takes longer than 250ms.

Describe the solutions you came up with

Increase the timeout before the native android part navigates.

Additional context

At the moment the js-side always has a onShouldStartLoadWithRequest, even if the developer did not set the prop. It is used to check the originWhiteList and to call the user-provided onShouldStartLoadWithRequest.

The developer does expect that the result of onShouldStartLoadWithRequest is respected.

De-couple this behavior and check the originWhiteList on the native side. Also let the native side know if the developer provided a onShouldStartLoadWithRequest. If not, just check the originWhitelist and then navigate accordingly. If onShouldStartLoadWithRequest is provided, call it from the native site and block the process like it is done at the moment. The timeout then can be increased to 1000ms or it can even be removed, if we are confident in error handling and error propagation back to the native side from onShouldStartLoadWithRequest.

Alternatively let the developer set a custom timeout on android on a per web-view basis (with the current default to 250ms). Then the developer can define the timeout for himself.

Source: react-native-webview/react-native-webview