New issue
Advanced search Search tips

Issue 889537 link

Starred by 2 users

Issue metadata

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



Sign in to add a comment

Warn developers about doing loadUrl(url) in shouldOverrideUrlLoading

Project Member Reported by torne@chromium.org, Sep 26

Issue description

Various past bugs have shown that developers often call loadUrl(url) in shouldOverrideUrlLoading, and then return true, instead of simply returning false. This causes various unexpected effects since it restarts the navigation instead of continuing it, and has tickled bugs in WebView before.

We could probably detect the most basic cases of this pretty easily and tell them this is wrong: just stash the URL somewhere before calling shouldOverrideUrlLoading and then if we receive a loadUrl call for the exact same URL (without any additional headers, which is a semi-valid use case), Log.w() a message telling them this is unnecessary.
 
Cc: timvolod...@chromium.org
Owner: laisminchillo@chromium.org
Status: Assigned (was: Available)
Could we start by logging a UMA histogram for this case? It'd be good to know how often apps do it, and in what cases. It might also be hard to support after S13N, so we'd want to know what the potential impact of breaking it could be.

Lais, maybe this is something you'd like to look into; adding a log message in the first place, and then learning how to add UMA if there's general agreement about that?
Cc: tobiasjs@chromium.org

Sign in to add a comment