New issue
Advanced search Search tips

Issue 767438 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Feature



Sign in to add a comment

Android WebView without internet permission fails request with vague message

Reported by romulo.f...@gmail.com, Sep 21 2017

Issue description

Steps 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: -
 
Labels: Needs-triage-Mobile
Cc: yhirano@chromium.org
Components: -Blink>Network Mobile>WebView
Labels: -Hotlist-Interop -Via-Wizard-API

Comment 3 by torne@chromium.org, 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.
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.

Comment 5 by torne@chromium.org, Sep 22 2017

Cc: torne@chromium.org
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.


Comment 6 by boliu@chromium.org, Sep 25 2017

Labels: -Type-Bug -Pri-2 -Needs-triage-Mobile Pri-3 Type-Feature
Status: Available (was: Unconfirmed)
Project Member

Comment 7 by sheriffbot@chromium.org, Sep 26

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
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
Cc: ntfschr@chromium.org
Labels: -Hotlist-Recharge-Cold WebView-triaged Valid-Difficult-Fix
This issue still exists, and it's still a valid feature request.
Status: Available (was: Untriaged)
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
Owner: hazems@chromium.org
Status: Assigned (was: Available)
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.
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