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

Issue 688183 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Long OOO (go/where-is-mgiuca)
Closed: Jun 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug

Blocking:
issue 621393



Sign in to add a comment

Implement "onappinstalled" and "onbeforeinstallprompt" attribute versions of the manifest events

Project Member Reported by mgiuca@chromium.org, Feb 3 2017

Issue description

Currently, you need to register for manifest events using:

  window.addEventListener("appinstalled", handleAppInstalled);
  window.addEventListener("beforeinstallprompt", handleBeforeInstallPrompt);

According to the spec [1] you should be able to register using the attribute version:

  window.onappinstalled = handleAppInstalled;
  window.onbeforeinstallprompt = handleBeforeInstallPrompt;

[1] https://www.w3.org/TR/appmanifest/#extensions-to-the-window-object
 
Project Member

Comment 2 by bugdroid1@chromium.org, Jun 9 2017

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

commit d0d175487822ae4ec8a217a6aa8abe8ab78da02e
Author: Matt Giuca <mgiuca@chromium.org>
Date: Fri Jun 09 04:05:05 2017

Adds onappinstalled and onbeforeinstallprompt event handler attributes.

This is in accordance with
https://www.w3.org/TR/appmanifest/#extensions-to-the-window-object.

You can now register these events using window.on<X> whereas previously
you could only use window.addEventListener("<X>").

Bug:  688183 
Change-Id: Idf6b83470cb44f276078f85685aa99aaf9443f1f
Reviewed-on: https://chromium-review.googlesource.com/505816
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Commit-Queue: Matt Giuca <mgiuca@chromium.org>
Cr-Commit-Position: refs/heads/master@{#478196}
[modify] https://crrev.com/d0d175487822ae4ec8a217a6aa8abe8ab78da02e/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/AddToHomescreenManagerTest.java
[modify] https://crrev.com/d0d175487822ae4ec8a217a6aa8abe8ab78da02e/chrome/browser/banners/app_banner_manager_browsertest.cc
[modify] https://crrev.com/d0d175487822ae4ec8a217a6aa8abe8ab78da02e/chrome/test/data/banners/appinstalled_test_page.html
[add] https://crrev.com/d0d175487822ae4ec8a217a6aa8abe8ab78da02e/chrome/test/data/banners/beforeinstallprompt_test_page.html
[modify] https://crrev.com/d0d175487822ae4ec8a217a6aa8abe8ab78da02e/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt
[modify] https://crrev.com/d0d175487822ae4ec8a217a6aa8abe8ab78da02e/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt
[modify] https://crrev.com/d0d175487822ae4ec8a217a6aa8abe8ab78da02e/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt
[modify] https://crrev.com/d0d175487822ae4ec8a217a6aa8abe8ab78da02e/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt
[modify] https://crrev.com/d0d175487822ae4ec8a217a6aa8abe8ab78da02e/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/d0d175487822ae4ec8a217a6aa8abe8ab78da02e/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/d0d175487822ae4ec8a217a6aa8abe8ab78da02e/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/d0d175487822ae4ec8a217a6aa8abe8ab78da02e/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/d0d175487822ae4ec8a217a6aa8abe8ab78da02e/third_party/WebKit/Source/modules/app_banner/BUILD.gn
[add] https://crrev.com/d0d175487822ae4ec8a217a6aa8abe8ab78da02e/third_party/WebKit/Source/modules/app_banner/DOMWindowInstallation.h
[add] https://crrev.com/d0d175487822ae4ec8a217a6aa8abe8ab78da02e/third_party/WebKit/Source/modules/app_banner/WindowInstallation.idl
[modify] https://crrev.com/d0d175487822ae4ec8a217a6aa8abe8ab78da02e/third_party/WebKit/Source/modules/modules_idl_files.gni

Status: Fixed (was: Assigned)

Sign in to add a comment