Re: [heycam/webidl] Need pattern for feature detecting dictionary members (#107)

@jan-ivar It's situational. What we're looking for in Web Share is an ability to detect whether it's going to work *before* calling the API. It's too late to throw an exception later.

The examples above don't do it justice (since they just check for errors immediately before). But for sharing images with Web Share you will be able to share an image thusly:

```js
navigator.share({image: myImage});
```

If you are writing a drawing app and want a share button, you would ideally hide or grey out the button by detecting image sharing support before the user clicks it:

```js
shareButton.disabled = !navigator.share.supports('image');
```

Otherwise, the user agent has no way to communicate to the website that image sharing will work until *after* the user clicks the button, which doesn't allow them to create a good user experience.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/107#issuecomment-304781451

Received on Tuesday, 30 May 2017 05:53:55 UTC