Webview Not Responding - Bug in iOS 12 and other versions
See original GitHub issue- Framework7 version: 4.4.6
- Platform and Target: iOS 12.2 and others
- Video showing the bug: https://youtu.be/eMo2mLAeO18
Bug Description
Webview becomes unresponsive suddenly (buttons, links and scrolling won’t work). Apparently it’s random but i noticed that it occurs after some ajax call.
The bug is very hard to reproduce due to its intermittency. I had a meeting with the team in order to reproduce it in a controlled environment and I noticed that when the freezing occurs, it generates no exception and there are no errors in the Xcode log.
Apparently the Webview freezes but changing the orientation works (the scrolling and buttons still unresponsive but we can see the orientation changing)
I noticed that the freezing occurs after some ajax request.
My guess for this bug is:
Before calling the ajax process, I call the dialog preloader just like the code below:
app.dialog.preloader('Loading...');
After the ajax call is processed, I close the preloader with the following code:
app.dialog.close();
The dialog box disappears but the scrolling, buttons and controls still unresponsive.
So I guess the bug is related to the dialog closing process. The box disappears but the page stills unresponsive just like when the preloader box is active.
When the Webview freezes, if the user leaves the app and open some app push notification that will redirects it to another page, the app performs the redirection correctly and it becomes responsive again. So we know that the app did not freeze. It’s only the Webview that becames unresponsive.
Here’s a video recorded by a team member demonstrating the issue:
To Reproduce
Due to its intermittency it is very hard to reproduce the error and there is no specific way to reproduce it.
Expected behavior
No webview freezing
Actual Behavior
Webview becomes unresponsive suddenly
Video
You can see the video demo here: https://youtu.be/eMo2mLAeO18
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
For me it seems like app doesn’t freeze but there is a transparent overlay that is still there that blocking all touch gestures. I can recommend you the following, attach device with your dev app installed from XCode, run the app, open Safari browser on Mac and inspect/debug device’s webview to see what happens there
I did as @shastox has suggested. I’ve updated the app to use wkwebview and the problem is now solved. Thank you very much Sergey!