Re: [w3c/manifest] App shortcuts / actions (#582)

> I think we should follow the behavior of existing features that have the same pattern (e.g. registerProtocolHandler and Web Share Target).

I’ll revisit those explainers.

> Are you saying the twitter PWA handles Windows-specific activation events?

Yes. Since PWAs on Windows are (currently) delivered by the Store, they are in a UWP wrapper. This gives them access to the WinRT feature set and all of the internals that make them run. The activation event is used for Share Target, Jump Lists, and more. I have an abbreviated example of how it is used with Share Target in [this demo](https://github.com/aarongustafson/WindowsShareTargetPWA). Here’s a slightly modified excerpt  from [the code](https://github.com/aarongustafson/WindowsShareTargetPWA/blob/master/j/WinRT.js):

```javascript
function activationHandler( e ) {
  console.log( 'Activation Event', e );
  if ( e.kind == ActivationKind.shareTarget ) {
    console.log( 'Handling the share' );
    shareHandler(e);
  }
}

if ( 'ActivationEvent' in window ) {
  activationHandler(window.ActivationEvent);
}
```

I intend to bring this approach up on the launch event discussion, but have not had a chance to do that yet (trying to get shortcuts wrapped first).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/manifest/issues/582#issuecomment-478759642

Received on Monday, 1 April 2019 21:46:01 UTC