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

Issue 884532 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Link to / redirect to PWA

Reported by collimar...@gmail.com, Sep 16

Issue description

Steps to reproduce the problem:
Currently it is not possible to link to or redirect to a PWA. Basically if you open the browser, then you cannot launch a PWA using a link or redirect.

This is a general issue, which also affects the following specific case.

If you send a web push notification or an email, using a service like Pushpad or Sendgrid, then your link will open a redirect page (hosted by Pushpad or Sendgrid) that tracks the click and then redirects to the actual website. The problem is that the notification or email link will always open a browser window instead of the standalone PWA.

The point is that Chrome should open the PWA when you enter a given scope, regardless of previous redirects: for example when it detects that the URL starts with example.com then it should open the PWA for example.com. Basically in the case of Pushpad / Sendgrid the click on the notification / email will not open the PWA immediately, however Chrome should open the PWA as soon as it enters the scope of the manifest.
Basically it would be great if Chrome could apply the manifest configuration (e.g. standalone) whenever the user enters inside the Manifest scope (as you already do for the UI color).

Tested on Chrome on Android

NOTE: I have posted the issue here on the Chromium bug tracker in case this behavior is implementation specific. However, in case this behavior is defined by the Manifest standard, I would be happy to move this issue on Github: https://github.com/w3c/manifest/issues

What is the expected behavior?
Chrome should open the PWA

What went wrong?
Chrome does not detect the intent and opens a normal browser window

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: <Copy from: 'about:version'>  Channel: n/a
OS Version: 
Flash Version:
 
I have posted this issue based on user feedback, which states that clicking a notification which opens a redirect page and then opens the actual website, does not launch the PWA associated to that website.

However, after further investigation, I can see that Chrome actually launches the PWA both when you click a direct link and when you click a link with redirect. So probably this is not a general Chrome bug, but it is something specific. I'll try to get more specific feedback from the user: otherwise we can close this issue.

In latest version of Chrome on Android, if I tap on a link pointing to a PWA within a web page, or calling window.open(), whether it is direct URL or URL redirection, it will launch my standalone PWA. 

In addition, tapping a direct/redirection link from external app works too (e.g. email app). It is ugly but works: it launches Chrome, which then launches my standalone PWA. 

However, in the case of push notification, within the notificationclick event, if I do

clients.openWindow(directUrl) 

It launches my standalone PWA as expected. When I do:
 
clients.openWindow(redirectUrl) 

It opens Chrome, then redirect to my PWA in the web browser. It does not launch my standalone PWA.
Labels: Needs-triage-Mobile
Cc: chelamcherla@chromium.org
Components: Blink>PushAPI Mobile>WebAPKs
Labels: Needs-Feedback Triaged-Mobile
@collimarco91: Please provide sample test case/URL to reproduce this issue, this would help in further triaging of the issue.

Thanks!
I don't have a PWA ready to share. However @ccchai has described the exact issue and maybe can give a link to his PWA.

Basically @ccchai was testing a PWA (with manifest) that uses the Pushpad service worker: https://pushpad.xyz/service-worker.js

1. When a notification is clicked, the Pushpad SW calls clients.openWindow(targetUrl) 
2. The targetUrl is a redirect page hosted on pushpad.xyz 
3. The redirect page returns an HTTP 302 redirect to the actual URL of the notification (e.g. example.com)

The problem described by @ccchai is that, after the redirect, the PWA for example.com is not launched (he gets a normal browser window).
Project Member

Comment 6 by sheriffbot@chromium.org, Sep 17

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: -chelamcherla@chromium.org sindhu.chelamcherla@chromium.org cccha...@gmail.com
Labels: Needs-Feedback
As per comment#5 cc'ing @ccchai for sample PWA on which this issue is seen along with screencast.

Thanks!
I have attached 2 screencasts. 

email.mp4: open a URL from an email app, it launches Chrome and then launches my standalone PWA.

push-notification.mp4: open the SAME URL from push notification, it launches Chrome and then open my website inside browser. This happens ONLY if the URL has redirect. In the case of direct URL, it will launch the standalone PWA as expected.

 





email.mp4
2.5 MB View Download
push-notification.mp4
2.2 MB View Download
Cc: pkotw...@chromium.org mgiuca@chromium.org
Peter can speak to the impl in Chrome on Android and Matt on the spec side. I don't remember exactly how the code works but I suspect that due to the redirect we're short-circuiting some of the logic to check whether there's an app that can handle the navigation
Yeah, that's exactly what happens in ServiceTabLauncher::dispatchLaunch() and further - the decision on whether to load a WebAPK or TWA is made based on the initial URL that is to be opened.

I don't know enough about the loading code to know whether it's sensible to change this. For now, consider opening a tab immediately for the target URL, and sending up any analytics you need separately.
Makes sense but within code like ExternalNavigationHandler and TabRedirectHandler there is opportunity to re-consider after the redirect but I'm just not sure about the interaction between notification click and this. It may need a user gesture or actually I suspect we're treating the navigation as though the user typed it into the omnibox in which case we explicitly don't consider external apps.
Owner: pkotw...@chromium.org
Status: Assigned (was: Unconfirmed)
HI, I'm facing the same issue with chrome 69.0.3497.100, android 5.1.1. an Url typed or clicked that should match a pwa scope is not open  anymore by  the pwa that owns the scope since Chrome 69. The URL is now opened on a Chrome tab. Chrome recognize the scope as the chrome menu shows an item 'open in (pwa name)'. Note : correct manifest, service worker and pwa installed on homescreen. To illustrate, have a try with https://superpwa.com , install pwa on screen and try to open  https://superpwa.com in Chrome. Pwa is not open as before.

Sign in to add a comment