Skip to content

Provide method to view webview console logs #32908

Closed
flutter/packages
#4705

Description

@tonyclickspace

Use case

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)

Activity

  1. fzyzcjy commented on Jul 3, 2020

    @fzyzcjy
  2. Nico04 commented on Dec 15, 2020

    @Nico04

    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.

  3. stuartmorgan-g commented on Apr 5, 2021

    @stuartmorgan-g
    Contributor

    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.

  4. added
    P3Issues that are less important to the Flutter project
    on Apr 5, 2021
  5. art926 commented on May 19, 2023

    @art926

    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.

  6. added
    P2Important issues not at the top of the work list
    and removed
    P3Issues that are less important to the Flutter project
    on Jul 25, 2023
  7. added a commit that references this issue on Oct 1, 2023
    c933398
  8. github-actions commented on Oct 15, 2023

    @github-actions

    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.

  9. locked as resolved and limited conversation to collaborators on Oct 15, 2023
  10. added a commit that references this issue on Jun 10, 2026
    30a4a43
  11. added a commit that references this issue on Jun 19, 2026
    ac7bca8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilitycustomer: quake (g3)p: webviewThe WebView pluginpackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions