You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provide method to view webview console logs #32908
Trying to debug issues with the WebView, but Flutter has no way of displaying / logging any logs or errors that the WebView is throwing. So debugging blind.
Proposal
Add an argument for the WebView it tell it how to handle / where to send console messages (a stream and/or print to the dev message window in debug mode)
Some third-parties web widget that I use throws errors in the web console, it would be nice to be able to read/parse the console to handle thoses events.
For Android this is potentially implementable; for iOS I don't think there's any way to do this other than to inject JS into the page (which isn't something we would want to do in general). Note that on iOS at least you can remotely debug WKWebView via Safari tools.
We'd really like to have it on iOS. In our case, we create a WebView that loads a script that fails right after, so there is no time to connect it and debug in an external browser. Maybe the WebView constructor could support an argument, that tells it that we're in a dbg mode and it would do some JS onerror injection to catch the error details.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
fzyzcjy commentedon Jul 3, 2020
Nico04 commentedon Dec 15, 2020
Some third-parties web widget that I use throws errors in the web console, it would be nice to be able to read/parse the console to handle thoses events.
stuartmorgan-g commentedon Apr 5, 2021
For Android this is potentially implementable; for iOS I don't think there's any way to do this other than to inject JS into the page (which isn't something we would want to do in general). Note that on iOS at least you can remotely debug WKWebView via Safari tools.
art926 commentedon May 19, 2023
We'd really like to have it on iOS. In our case, we create a WebView that loads a script that fails right after, so there is no time to connect it and debug in an external browser. Maybe the WebView constructor could support an argument, that tells it that we're in a dbg mode and it would do some JS onerror injection to catch the error details.
[webview_flutter_platform_interface] Adds option to override console …
[webview_flutter_wkwebview] Adds WKWebView implementation to override…
[webview_flutter_android] Adds Android implementation to override con…
[webview_flutter] Adds app facing implementation to override console …
github-actions commentedon Oct 15, 2023
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.[webview_flutter] Adds app facing implementation to override console …
[webview_flutter] Adds app facing implementation to override console …