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

Issue 906367 link

Starred by 2 users

Issue metadata

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



Sign in to add a comment

Scope incorrect for Add to Homescreen prompt

Reported by thomas.s...@gmail.com, Nov 17

Issue description

Steps to reproduce the problem:
1. Create a service worker and manifest at a scope (say in /pageOne/) and visit the web page, click the install to Homescreen prompt.
2. Create a second service worker and manifest at a scope with a the same prefix, but different folder (say in /pageOneHundred/).

What is the expected behavior?
Both service workers should display the add to homescreen prompt.
Both service workers should appear in chrome://webapks.

What went wrong?
The second page did not prompt to install. It appears like the scope of the "add to homescreen" prompt is missing the trailing "/" on its scope check (ie: it is just matching /pageOne*), so the second service worker's scope of the "add to homescreen" prompt is now included in the first page, so it does not prompt on the second page.

I moved the second page to a unique prefix folder (say in /oneHundredPage/), and visit the page and it immediately prompts to install.

Did this work before? Yes It works properly on a Nexus 7 running Chrome 70.0.3538.80. It does not work on that same Chrome version on the Pixel 3 XL or on the Dev channel on the Pixel 3 XL.

Chrome version: 72.0.3610.2  Channel: dev
OS Version: 9 PQ1A.181105.017.A1
Flash Version: 

The service worker and app work fine, it just doesn't prompt to install.

Also, when I click on the menu on the chrome bar, it says "Open Page One" ("Page One" is the name in the manifest), it should say "Open Page One Hundred", which is the name in it's manifest. It does shows the "Open Page One Hundred" on the Nexus 7, where the add to homescreen prompt worked properly.
 
Check Canary on Pixel 3 XL (72.0.3613.0) and does not work properly there either.
Labels: Needs-triage-Mobile
Cc: chelamcherla@chromium.org
Components: Mobile>WebAPKs
Labels: Triaged-Mobile Needs-Feedback
@thomas.samoht: Could you please provide test URL to test this issue from our end. Please provide a screencast, this would help in further triaging of the issue.

Thanks!
Test URLs:

https://wetmore.ca/chrometest/one/one.pl

https://wetmore.ca/chrometest/oneHundred/oneHundred.pl (files are identical except for name changes)

https://wetmore.ca/chrometest/two/two.pl (files are identical except for name changes)


Screenshots from Pixel 3 XL:

1. Go to first page https://wetmore.ca/chrometest/one/one.pl and click on "Add One to Home screen".
2. Click Add to add it to the home screen.
3. Refresh the web page, and then click the Chrome menu button. Note it now has the option "Open One".
4. Go to the second page https://wetmore.ca/chrometest/oneHundred/oneHundred.pl and notice there is no pop-up option to "Add One Hundred to Home screen".
5. Click the Chrome menu button. Note it has the option to "Open One". This is the other web app, that it is getting confused about and thinks this is the same as the other one.
6. Go to third page https://wetmore.ca/chrometest/two/two.pl and note it pops-up the "Add Two to Home screen" message, as it should. The URL and app names are the only differences between these pages.
Project Member

Comment 5 by sheriffbot@chromium.org, Nov 19

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 jstenback@chromium.org
Components: -Blink UI>Browser>WebAppInstalls
Cc: mgiuca@chromium.org pkotw...@chromium.org yfried...@chromium.org hanxi@chromium.org
Owner: pkotw...@chromium.org
Status: Assigned (was: Unconfirmed)
In summary:

1. install a WebAPK with start_url "/one/one.pl"
2. visit "/oneHundred/oneHundred.pl" on the same origin
3. note that the menu item reads "Open..." instead of "Install", which isn't correct in this case.

The menu item reading "Open..." instead of "Install" for the second URL indicates that WebApkValidator#resolveInfosForUrlAndOptionalPackage is returning a resolve info that allows the "one.pl" WebAPK to handle the URL "oneHundred/oneHundred.pl", even though that second URL is outside of the scope.

I see two possible reasons:

1. the trailing slash is somehow dropped somewhere in the construction of the WebAPK
2. Android's PackageManager is ignoring the trailing slash in the WebAPK scope when checking what URLs it can handle in returning the resolve infos

pkotwciz, could you follow up here?
I installed a WebAPK for https://wetmore.ca/chrometest/one/one.pl and inspected the AndroidManifest.xml.
The scope in the <meta-data> tag is correct. The android:pathPrefix in the intent filter is wrong.

<meta-data android:name="org.chromium.webapk.shell_apk.scope" android:value="https://wetmore.ca/chrometest/one/">

<intent-filter>
  <data android:scheme="https" android:host="wetmore.case" android:pathPrefix="/chrometest/one/"></data>
</intent-filter>
Filed a server at http://b/120074504
I'm confused about comment #8:

The intent-filter you posted looks right to me. Is "/chrometest/one/" the value we want it to have, or the value you observed? If the latter, then what value do we want?
Correction: android:pathPrefix observed is /chrometest/one
Sorry for the confusion
To clarify:

 - intent filter observed was /chrometest/one
 - the desired intent filter is /chometest/home/

Hence the trailing slash has been lost in the minting process?

Sign in to add a comment