Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crashes on iOS when opening websites with Cloudflare protection #3412

Open
opensourcex123 opened this issue Apr 24, 2024 · 0 comments
Open

Comments

@opensourcex123
Copy link

Bug description:
On the ios platform, when i open the webview with uri: https://rocketpool.net, the app crashed, and when i open it on the website, it gave me a 403 forbidden error. All console were not printed according to the code below.

To Reproduce:

    <WebView
      onError={syntheticEvent => {
        const {nativeEvent} = syntheticEvent;
        console.warn('WebView error: ', nativeEvent);
      }}
      onLoadProgress={({type, nativeEvent}) => {
        console.log('load', nativeEvent);
      }}
     onHttpError={syntheticEvent => {
        const {nativeEvent} = syntheticEvent;
        console.warn(
          'WebView received error status code: ',
          nativeEvent.statusCode,
        );
      }}
      onLoadEnd={event => {
        console.log('load end', event);
      }}
      onContentProcessDidTerminate={syntheticEvent => {
        const {nativeEvent} = syntheticEvent;
        console.warn('Content process terminated, reloading', nativeEvent);
        this.refs.webview.reload();
      }}
      renderError={errorName => <Text>{errorName}</Text>}
      source={{
        uri: 'https://rocketpool.net',
        headers: {
          'User-Agent':
            'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36',
        },
      }}
    />
  );

Expected behavior:
Al least show me some cloudflare website, like when i open it on the pc.
image

Screenshots/Videos:

Environment:

  • OS:ios
  • OS version:16.7.7
  • react-native version:0.73.5
  • react-native-webview version:13.6.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant