BeforeInstallPromptEvent.prompt() should not show a prompt if app already installed |
||
Issue descriptionChrome Version: 66 OS: Chrome (and other desktop) What steps will reproduce the problem? (1) Visit https://airhorner.com/ (2) Wait until the Install button shows. (3) Chrome menu -> Add to Shelf (do *not* use the install button). (4) Install the app. The browser tab pops out to an app window. (5) Click the Install button. What is the expected result? The Install button should do nothing. (Note: The app should remove the Install button when it receives the appinstalled event, but that is not a Chrome bug.) What happens instead? The Install button shows a second install prompt. Clicking "Add" does nothing.
,
Mar 20 2018
Hmm wait, since this is using Add to Shelf, the call is better made in AppBannerManager::OnInstall(), which is called by the Add to Shelf code path.
,
Mar 20 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/10f218c6c9b29d8a163c87a7b6a725a39bf2d07f commit 10f218c6c9b29d8a163c87a7b6a725a39bf2d07f Author: Dominick Ng <dominickn@chromium.org> Date: Tue Mar 20 09:50:24 2018 Reset event bindings in AppBannerManager::OnInstall. This addresses a bug where sites using the beforeinstallpromptevent to implement an install button could have users trigger a do-nothing install prompt if the user first used the menu item "Add to Shelf" to install, and then pressed the beforeinstallprompt-connected button. Resetting the event binding when the OnInstall() method is triggered means that when an install is started, all outstanding beforeinstallpromptevents are voided, fixing the bug. BUG= 823602 Change-Id: Ib2c747c74f7083a7663580ed37da7a319d9a9c60 Reviewed-on: https://chromium-review.googlesource.com/970050 Reviewed-by: Matt Giuca <mgiuca@chromium.org> Commit-Queue: Dominick Ng <dominickn@chromium.org> Cr-Commit-Position: refs/heads/master@{#544317} [modify] https://crrev.com/10f218c6c9b29d8a163c87a7b6a725a39bf2d07f/chrome/browser/banners/app_banner_manager.cc
,
Mar 20 2018
|
||
►
Sign in to add a comment |
||
Comment 1 by dominickn@chromium.org
, Mar 20 2018