Intent to Implement and Ship: onappinstalled and onbeforeinstallprompt event attributes

54 views
Skip to first unread message

Matt Giuca

unread,
Jun 6, 2017, 3:23:43 AM6/6/17
to blink-dev

Contact emails

mgi...@chromium.org

 

Spec

https://w3c.github.io/manifest/#extensions-to-the-window-object

 

Summary

The proposal is to add window.onappinstalled and window.onbeforeinstallprompt attributes which can be used to set event handlers.


These event types have already been implemented in stable (using window.addEventListener to listen for 'appinstalled' and 'beforeinstallprompt' events, respectively). This intent is just for adding the attribute version.

 

Motivation

It's in the spec, and there's an expectation that events can be listened with either addEventListener('<X>') or on<X>. Frankly, I'm not sure why we don't just enforce both versions in Chrome architecturally (as apparently Firefox does).

 

Interoperability and Compatibility Risk

Low, since we already have implemented the event; this just adds the new attribute to the window namespace. We don't know whether Edge or Safari will ship this, but it hasn't stopped us from shipping the events themselves.

 

Edge: No signals

Firefox: appinstalled: In development*, beforeinstallprompt: Public support

Safari: No signals

Web developers: No signals


*Note: According to MDN, Firefox supports onappinstalled behind a flag. Indeed, turning on the flag "dom.manifest.oninstall" in Firefox 53 results in "window.onappinstalled" being available, but I can't find any actual way to trigger installation from within the Firefox UI.

 

Ongoing technical constraints

None

 

Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes (though may not yet fire on desktop platforms as we may not fire these events there; the listeners will still be present).


OWP launch tracking bug

https://crbug.com/688183

 

Link to entry on the feature dashboard

https://www.chromestatus.com/feature/6560913322672128

 

Requesting approval to ship?

Yes.

Rick Byers

unread,
Jun 6, 2017, 10:50:39 AM6/6/17
to Matt Giuca, blink-dev
LGTM1
These may also be important for feature detection purposes.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAHqYdcYHz4h6xWc69vnn5ngK-fd4j3o-NTiEu7q32esct1bY9w%40mail.gmail.com.

Chris Harrelson

unread,
Jun 6, 2017, 11:04:27 AM6/6/17
to Rick Byers, Matt Giuca, blink-dev
LGTM2

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFUtAY8M_ytNZFGFTCCpBLyDXHHccxikMg9-exBtDcyRgKDz3g%40mail.gmail.com.

TAMURA, Kent

unread,
Jun 6, 2017, 11:26:30 PM6/6/17
to Chris Harrelson, Rick Byers, Matt Giuca, blink-dev
LGTM3.


Johnny Stenback

unread,
Jun 9, 2017, 5:27:19 PM6/9/17
to Matt Giuca, blink-dev
On Tue, Jun 6, 2017 at 12:23 AM, Matt Giuca <mgi...@chromium.org> wrote:

Motivation

It's in the spec, and there's an expectation that events can be listened with either addEventListener('<X>') or on<X>. Frankly, I'm not sure why we don't just enforce both versions in Chrome architecturally (as apparently Firefox does).


Did you by chance file a bug on file for considering adding this enforcement? If not we should get one filed.

Thanks,
Johnny

Matt Giuca

unread,
Jun 13, 2017, 12:05:22 AM6/13/17
to Johnny Stenback, blink-dev
OK I just filed one: https://crbug.com/732663.
Reply all
Reply to author
Forward
0 new messages