Problem with webview in IOS (web mobile)

(Cocos 3.3.0) I builded a web mobile project that include using webview. When I try tested it on Iphone or Ipad, most of the time the page keeps refresh after it try to load for a while.

I find that while webview loading resource from the website, the framerate drop to 0-1. Is it about the performance?

These are the webs that I use in my webview project

https://m.pg-demo.com/mermaid-riches/index.html?language=en-US&bet_type=2&operator_token=8735ze6y8kp7jpwmxvau7gvytu3adwj4&from=https%3A%2F%2Fpublic.pg-redirect.com%2Fpages%2Fclose.html&__refer=m.pg-redirect.com&__sv=0

https://m.pg-demo.com/buffalo-win/index.html?language=en-US&bet_type=2&operator_token=8735ze6y8kp7jpwmxvau7gvytu3adwj4&from=https%3A%2F%2Fpublic.pg-redirect.com%2Fpages%2Fclose.html&__refer=m.pg-redirect.com&__sv=0

https://m.pg-demo.com/crypt-fortune/index.html?language=en-US&bet_type=2&operator_token=8735ze6y8kp7jpwmxvau7gvytu3adwj4&from=https%3A%2F%2Fpublic.pg-redirect.com%2Fpages%2Fclose.html&__refer=m.pg-redirect.com&__sv=0

I can ask engineering to review this topic.

Thank you very much. That will help a lot.

The test is easy to reproduce in case of poor network.
Dropping frames during the loading process is a normal phenomenon. It is recommended not to load all resources at once, and some resources can be loaded when they are to be used to reduce the number of network requests.

I want to think like that. But in my case, even when I use webview and nothing else, the site still keep refreshing itself. There’s no problem like this in android. I tried make webview node inactive when the site is loading resource but the page keeps refresh when I enable the node as well( And yes, the web keep loading resource even when I disable the node.)

Test with webview

Test with direct open on Safari

I provide the link for you to see the difference

Is it convenient to use safari to debug the real machine to see if there are error stacks?
Or provide a simple demo that can be reproduced.

I don’t know how to debug the machine on safari, sorry for that.

as the demo project, I can provide it for you but it literally just a blank project with webview and a single script to toggle the webview on and off. I use it to find issue before asking about it here

Github test project


The link is not working.
Debugging steps:
iphone:
1.Settings–>safari–>Advanced–>Open web inspector
mac:
2.Safari → Preferences → Advanced → Show “Develop” menu in the menu bar
3. Connect your phone and computer.
4. Run the app and load the H5 interface.
Click “Develop” in the safari menu and you will have the H5 interface loaded on your real iphone device.

Sorry, my github was set in private. Now should be able to reach my project .

The test found that your game has a running memory of nearly 2G, which triggers the safari protection mechanism due to the high running memory.
You need to.

  1. check for memory leaks.
  2. Do a good job of memory management and recover the memory space occupied by cache resources in a timely manner.
  3. compress the image resources.
1 Like