Open larryluo1212 opened 3 years ago
Hi @larryluo123
I tried your code with 30.000
and it does not crashed. This may not be related to the webView plugin but instead with your code, loading items like this take so much memory of your device and this is not a best practice.
I tested on a iPhone simulator and this was my output:
Performing hot restart...
Syncing files to device iPhone 11 Pro Max...
Restarted application in 2,640ms.
flutter: onPageFinished
flutter: htmlHeight : 810000
On what device did you executed this code? what number did you added in the for loop that caused the issue?
Can you provide the output of flutter run -v
?
Phone 11 Pro Max.
Thank you for your reply. I ran the code above to reproduce what I said.I use the iPhone 11 Pro Max simulator to display normally.My mobile phone is iPhone 6S plus, IOS 13.6, and the following is “flutter run - v” log
Hi @larryluo123 I tried your code with
30.000
and it does not crashed. This may not be related to the webView plugin but instead with your code, loading items like this take so much memory of your device and this is not a best practice.I tested on a iPhone simulator and this was my output:
Performing hot restart... Syncing files to device iPhone 11 Pro Max... Restarted application in 2,640ms. flutter: onPageFinished flutter: htmlHeight : 810000
On what device did you executed this code? what number did you added in the for loop that caused the issue? Can you provide the output of
flutter run -v
?
what number did you added in the for loop that caused the issue?
Hi @larryluo123 Can you answer this? I need to know what number did you used to reproduce the issue.
what number did you added in the for loop that caused the issue?
Hi @larryluo123 Can you answer this? I need to know what number did you used to reproduce the issue.
3000 leads to blank, I haven't changed the code at present,
String html = "<!DOCTYPE html>" + "<html>" + " <head>" + " <meta charset=\"UTF-8\">" + " <script>" + " window.onload = function(){" + " var aDiv = document.getElementsByTagName('div');" + " " + " var str = \"\";" + " for(var i = 0,j = 0;i<3000;i++ ){" + " str += \"<div>test webview html \"+ i + \"</div>\";" + " }" + " document.body.innerHTML = str;" + " }" + " </script>" + " </head>" + " <body>" + " " + " </body>" + "</html>";
I still cannot reproduce the issue with the code you provided.
Based on the logs you provided on https://github.com/flutter/flutter/issues/66439#issuecomment-698192012 looks like you did not reproduced the issue.
Please, run your code with flutter run -v
and one the exception is thrown copy and paste it here in the comments, you can also share it as a .txt file if it is too large.
I still cannot reproduce the issue with the code you provided.
![]()
Based on the logs you provided on #66439 (comment) looks like you did not reproduced the issue.
Please, run your code with
flutter run -v
and one the exception is thrown copy and paste it here in the comments, you can also share it as a .txt file if it is too large.
I found that I can use the iPhone simulator to display normally and no exception is thrown. When I use the iPhone 6S plus real machine for testing, it displays at first, and then it turns white. If I use 'flutter run - v', there is no exception thrown. When I execute the code in Xcode, there will be an exception.
Here is my Log: https://docs.google.com/document/d/1mCVZ_0AFguOnj1eYc081K90wSLF5JWNeBL2rNo6yS2k/edit?usp=sharing
The issue is reproducible on master 2.5.0-6.0.pre.63
and stable 2.2.3
with webview_flutter: ^2.0.12
. On Android
, the issue cannot be reproduced with hybrid composition
enabled, however, the app crashes if it is disabled. On iOS
, a blank screen is shown.
+1
Facing the same issue on iOS. Any news here?
I'm facing a similar issue, only on iOS devices. When I scroll down and then navigate back using location.back(), the content is partially or completely hidden (depending on the point from where I navigate to another page). This only happens when the content of the page is long. Once I start scrolling again, the content reappears. When using the Angular router, everything works fine. Check video: https://github.com/user-attachments/assets/908599d7-9d42-4b02-9bec-9f5132751e94 This one looks similar: #148344
Steps to Reproduce
Sample code
```dart import 'dart:convert'; import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:webview_flutter/webview_flutter.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( body: WebViewSample(), ), ); } } class WebViewSample extends StatefulWidget { @override createState() => _WebViewState(); } class _WebViewState extends Statewebview_flutter: ^0.3.24
Expected results: It is expected that long loaded HTML can be displayed normally,
Actual results: According to the layout nesting in my code, loading long HTML can not be displayed normally, blank, loading short HTML can be displayed normally
Logs
``` 2020-09-23 18:17:19.127238+0800 Runner[2685:137016] WF: _WebFilterIsActive returning: NO 2020-09-23 18:17:19.506430+0800 Runner[2685:137103] flutter: onPageFinished 2020-09-23 18:17:19.662384+0800 Runner[2685:137103] flutter: htmlHeight : 81000 2020-09-23 18:17:21.016750+0800 Runner[2685:137016] WF: _userSettingsForUser mobile: { filterBlacklist = ( ); filterWhitelist = ( ); restrictWeb = 1; useContentFilter = 0; useContentFilterOverrides = 0; whitelistEnabled = 0; } 2020-09-23 18:17:21.016823+0800 Runner[2685:137016] WF: _WebFilterIsActive returning: NO 2020-09-23 18:17:21.142529+0800 Runner[2685:137016] [ProcessSuspension] 0x119ce1740 - ProcessAssertion::processAssertionWasInvalidated() 2020-09-23 18:17:21.341480+0800 Runner[2685:137103] flutter: onPageFinished 2020-09-23 18:17:21.593578+0800 Runner[2685:137103] [VERBOSE-2:ui_dart_state.cc(166)] Unhandled Exception: PlatformException(evaluateJavaScript_failed, Failed evaluating JavaScript, JavaScript string was: 'document.body.scrollHeight' Error Domain=WKErrorDomain Code=2 "The Web Content process was terminated" UserInfo={NSLocalizedDescription=The Web Content process was terminated}) #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:572:7) #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:161:18)Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.5 19F101, locale en-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3) [✓] Xcode - develop for iOS and macOS (Xcode 11.6) [✓] Android Studio (version 4.0) [✓] Connected device (1 available)
• No issues found!