New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 741048 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Blank page shown when closing CCT

Project Member Reported by pkotw...@chromium.org, Jul 11 2017

Issue description

Repro steps:
1) Modify WebappLauncherActivity.java to always return true in WebappLauncheractivity#isValid()
2) Install the attached base.apk (App name = "Short Name") which has scope="https://www.google.ca/"
3) Launch the installed WebAPK
4) Search for "amazon" from the WebAPK home page
5) Long tap on the first search result. A dialog should show up.
6) Back out of the dialog
7) Tap the first search result. This should open the CCT at amazon.ca
8) Press back to get out of the CCT

Expected:
CCT closes. I should be back at the Google search results
Actual:
CCT closes. I am on a blank page

I found this bug by random luck. It is 100% reproductible though
 
base.apk
25.8 KB Download

Comment 1 Deleted

This bug seems to have to do with redirects. In particular, long pressing on the search result (in step #5) seems to change the URL navigated to by tapping on the Google search result (in step #7)

After long pressing on the search result (and closing the dialog), tapping the link navigates to
https://www.google.ca/url?sa=t&source=web&rct=j&url=https://www.amazon.ca/&ved=0ahUKEwiPrNOf_IHVAhVI7IMKHT3UBWoQFgguMAA&usg=AFQjCNHtWpf7QVxR4Qdb7r4h-hyHKYW45g

(which is a redirect) instead of immediately navigating to

https://www.amazon.ca/

Comment 3 by piotrs@google.com, Jul 11 2017

Arguably it's a bug on https://www.google.ca and not in Chrome if I understand correctly. WDYT?

Comment 4 by piotrs@google.com, Jul 11 2017

On a second thought I think we could have some better handling of redirects. We could ensure we pop most recent item from the history stack if it resulted in a redirect, so that on navigating back to PWA you see last "real" entry and not this blank page this bug is talking about.
I suspect that it will be hard to detect whether the most recent item in the history stack resulted from a redirect.

- Chrome does not tag all redirects as redirects
- Chrome sometimes thinks that a single redirect chain is multiple redirect chains. This occurs when a redirect chain is composed of both HTTP 301 and JavaScript redirects

A few years ago, for a project (which got cancelled) I experimented with opening a new tab when a user navigated to a new origin. I got stuck with redirects

Comment 6 by piotrs@chromium.org, Jul 12 2017

So if understanding redirects well is very hard/fiddly, do you have any other idea how we could mitigate this scenario?
Turns out that the Clank team has already solved this problem for intents to external apps (Like opening the twitter app from Google search results). In order to mitigate this scenario you need the second part of InterceptNavigationDelegateImpl#onOverrideUrlLoadingAndLaunchIntent()

Comment 8 by piotrs@chromium.org, Jul 14 2017

Cc: pkotw...@chromium.org
Owner: piotrs@chromium.org
Status: Assigned (was: Untriaged)
I will look into this soon.
Components: UI>Browser>WebAppInstalls
Owner: pkotw...@chromium.org
I will not have time to look into this or to judge whether are any action items for us on this. Peter, sending to you to exercise your judgement.
Ok, I will take a look
Project Member

Comment 12 by bugdroid1@chromium.org, Nov 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/384a1a848222a0b729321d06694a89d43e5551ab

commit 384a1a848222a0b729321d06694a89d43e5551ab
Author: Peter Kotwicz <pkotwicz@chromium.org>
Date: Sun Nov 26 22:14:15 2017

[Android WebAPK] Return to sensible page when closing CCT opened from TWA

This CL changes the behavior when a user taps a link from PAGE A to PAGE B where:
- PAGE B is in scope of the TWA
- the link redirects to PAGE C which is not in the scope of the TWA

This CL causes the TWA to navigate back to the last page that the user
interacted with (PAGE A). This way when the user closes the CCT
(which would have navigated to PAGE C), the user sees PAGE A instead
of PAGE B.

BUG= 741048 

Change-Id: I26e8725ab54629f215787fd830d756194e6c3955
Reviewed-on: https://chromium-review.googlesource.com/780901
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: Maria Khomenko <mariakhomenko@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519196}
[modify] https://crrev.com/384a1a848222a0b729321d06694a89d43e5551ab/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java
[modify] https://crrev.com/384a1a848222a0b729321d06694a89d43e5551ab/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappInterceptNavigationDelegate.java
[modify] https://crrev.com/384a1a848222a0b729321d06694a89d43e5551ab/chrome/android/javatests/DEPS
[modify] https://crrev.com/384a1a848222a0b729321d06694a89d43e5551ab/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebApkIntegrationTest.java
[modify] https://crrev.com/384a1a848222a0b729321d06694a89d43e5551ab/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappNavigationTest.java

Status: Fixed (was: Assigned)

Sign in to add a comment