w3c / web-share

Web API proposal for sharing data from a web page
https://www.w3.org/TR/web-share/
Other
353 stars 65 forks source link

Should calling share() "consume" the activation? #136

Closed marcoscaceres closed 4 years ago

marcoscaceres commented 4 years ago

HTML has a new use activation model that helps deal with situations like:

button.onclick = () => {
  const pShare = navigator.share(stuff);
  // should this reject? 
  const pFS = document.body.requestFullscreen();
}

Given the somewhat modal nature of the share sheet/context-popup menu (Safari desktop), it might make sense to consume the activation?

Doing so might have the nice effect that we can get rid of the internal slot we added to protect against being able to call .share() twice during the same activation phase.

This would be a small breaking change for the currently implemented behavior.

marcoscaceres commented 4 years ago

@othermaciej, we are unsure who to ping on the WebKit side for input on Web Share? Could you suggest someone (or possibly you have an opinion on the above)?

My opinion is that we should consume the activation on share() for the reasons I stated above.

othermaciej commented 4 years ago

@whsieh @hortont424 @rniwa @jernoble are some people who may have informed opinions.

We don't yet implement the new activation model, but I take it the upshot of this is that a single user action shouldn't be able to open multiple share sheets, or share sheets plus other alerts, or open the sheet plus do other things like play or go fullscreen. That probably seems right.

marcoscaceres commented 4 years ago

Draft proposal https://github.com/w3c/web-share/pull/137