Should detect WebAPK is installed correctly even if native app for same website is installed
Reported by
abhishek...@gmail.com,
Dec 3
|
|||||
Issue descriptionSteps to reproduce the problem: 1. Take a website that has both a native app and a A2HS experience (eg. Flipkart.com or Instagram.com) 2. Install the native app from Play Store 3. Install the WebAPK from website (A2HS flow) 4. Once the WebAPK is installed successfully, try to go through the A2HS process again and see that you are able to get the installation prompt and start an install as many times as you want. This means that the snackbar at the bottom of the screen saying "Add <website> to homescreen" is also visible again and annoys the user. 5. If you uninstall the native app, this issue is not seen anymore. A video showing the issue and steps to reproduce is available below. What is the expected behavior? Once WebAPK is installed, the website should not get a BeforeInstallPrompt and the user should not be able to install multiple copies of the WebAPK (either through context menu or snackbar) What went wrong? Add to Homescreen did not change to "Open...", Snack bar was shown repeatedly, and BeforeInstallPrompt was raised as well. Basically, Chrome was not able to detect that a WebAPK exists on the device fo this website. This does not happen when the native app is not installed on the device. I believe there is some bug/conflict somewhere trying to understand what apps exists that register intents to capture URLs of the said website. Did this work before? N/A Chrome version: 70.0.3538.110 Channel: stable OS Version: 8.1.0 Flash Version: For some websites, actually two copies of WebAPK are not installed while for other websites, you could actually download and install two copies of WebAPK generated for the same website (of course they'll have different android package names generated similar to something like org.chromium.<something>)
,
Dec 4
,
Dec 4
Tested the issue in Android and able to reproduce the issue. Steps Followed: 1. Navigated to play store and installed flipkart app 2. Now opened chrome and navigated to flipkart.com 3. Added to homescreen from below snack bar, -- successfully added to homescreen. 4. Now reloaded and observed add to home screen snack bar Chrome versions tested: 60.0.3112.113 , 70.0.3538.110 OS: Android 9.0.0 Android Devices: Pixel 2 Issue is seen in from older M-60 builds, hence considering as Non-Regression and marking as Untriaged for further inputs from dev team. Thanks!
,
Dec 4
I suspect the problem is that the native app has a verified intent filter. This means that when we query to see which apps can handle the intent and to see whether a webapk is installed, we don't see the webapk. Perhaps a reasonable workaround is to check shared prefs to see if we're aware of the webapk. It's also not bullet-proof though if user clears data but would handle the 99% case
,
Dec 4
I checked and verified that both those apps have digital asset links set up for their native apps so I think that's likely
,
Dec 6
To clarify Yaron, your suggestion is to check shared prefs for the existence of a WebAPK with a scope containing the URL in question (before checking the intent filters)? That sounds like a reasonable enough solution to me here.
,
Dec 6
Yep, that's the idea. However it's not free. We'd have to potentially read shared prefs files for all webapks which I definitely wouldn't want to block navigation on cause they aren't normally loaded (This affects tabbed browsing too) So it's probably worth thinking a bit more about and/or doing as much caching as we can to keep this lean
,
Dec 27
How about adding intent category like "android.intent.category.WEBAPK_PACKAGE" to both AndroidManifest.xml in webapk and WebApkValidator::resolveInfosForUrlAndOptionalPackage? It assumes that there are no same url on all webapks.
,
Jan 2
#8: Interesting, that may work. I guess the assumption is that adding the category would disqualify verified intent handling? I'm not actually sure if that's true. If it is, then we would first have to roll out the change to the webapks and then update chrome.
,
Jan 2
Issue 917665 might mitigate this bug |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by abhishek...@gmail.com
, Dec 34.1 MB
4.1 MB View Download