Android WebView without internet permission fails request with vague message
Reported by
romulo.f...@gmail.com,
Sep 21 2017
|
||||||||
Issue descriptionSteps to reproduce the problem: 1. Create an Android app with a WebView 2. Forget to add Internet permission 3. Try to access any external resource What is the expected behavior? Browser fails the request with some kind of message warning that it's because the app does not have Internet access permissions. What went wrong? Browsers fails the request correctly, but without any explanatory message. Did this work before? No Does this work in other browsers? Yes Chrome version: 60.0.3112.116 Channel: stable OS Version: 6.0 Flash Version: -
,
Sep 22 2017
,
Sep 22 2017
Where are you exepcting a message? Visibly in the WebView? Or to the developer in logcat? We probably don't want to surface a visible message to the user because the user can't do anything about this - it's the developer's mistake if they intend for the webview to be able to access the internet but didn't add the permission, and if they don't intend for it to be able to then a generic error page is probably fine (and the developer can override this anyway). But calling it out in logcat is probably reasonable if there's an easy way.
,
Sep 22 2017
This usually happens on Cordova Apps trying to access internet, so the trigger is in javascript. A logcat message might pass unseen, so I think the best option here is to show a console error message and/or any info on Developer Tools network tab.
,
Sep 22 2017
I'm not sure if we currently do any webview-specific console messages but that does seem like a useful mechanism we should have if we don't, and we may want to look at surfacing other info there. Right now Cordova developers should definitely be looking at logcat and not just the JS console - there are many other errors/warnings WebView displays in logcat. But, this is a good point that we should consider. Thanks for the input; that was a really useful perspective.
,
Sep 25 2017
,
Sep 26
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Sep 26
This issue still exists, and it's still a valid feature request.
,
Sep 26
,
Sep 28
For future reference, we might create the warning with WebContents#addMessageToDevToolsConsole [1]. It would make sense to do this during #onReceivedError(), but I think the error code is too vague (ERR_UNKNOWN) by the time we get to glue layer. Another approach is to check for internet permission when we load the first over-the-internet resource. That said, I'm not sure if addMessageToDevToolsConsole() even works in WebView? I can't get it working locally. [1] https://cs.chromium.org/chromium/src/content/public/android/java/src/org/chromium/content_public/browser/WebContents.java?l=297&rcl=9ef7b77d07c1eff5117d06bcc539c0cfa0fe167f
,
Oct 30
Hazem may be able to look at this soon to find a good way to log messages to the dev tools console in WebView, and get this message moved over to there.
,
Oct 31
Awesome! It might be worth trying out the native method as well (I don't think I got a chance to try this). https://cs.chromium.org/chromium/src/content/public/browser/render_frame_host.h?l=168&rcl=b795666f9151ed7cca128c6a31fdfb11f6a7a3f2 |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by ligim...@chromium.org
, Sep 21 2017