Re: [mediacapture-screen-share-extensions] Tab capture control (#13)

> > The UA can prompt instead of scroll (or prompt instead of zoom +/- button). No promise needed.
> 
> The established pattern is to use permission policies and return a promise through which the application can detect whether permission was granted or not.

There's no singular pattern. Some examples of instant permission failure without prompt:
- [requestFullscreen()](https://fullscreen.spec.whatwg.org/#dom-element-requestfullscreen) has a synchronous¹ [permission check](https://fullscreen.spec.whatwg.org/#fullscreen-element-ready-check) (the promise is to know when the transition is complete)
- (auto) [play()](https://html.spec.whatwg.org/multipage/media.html#dom-media-play) has a synchronous permission check (the promise is to know when we [HAVE_ENOUGH_DATA](https://html.spec.whatwg.org/multipage/media.html#dom-media-have_enough_data))
- window.open() will fail if popup-blocked, then trigger a "retry?" notification in most browsers 

But when and where to prompt is often up to UAs. If we wanted the first scroll attempt to fail with a prompt, I don't see why not.

That said, I'd prefer https://github.com/w3c/mediacapture-screen-share-extensions/issues/14 to conclude with no permission needed. Just trying to untangle discussion.

> ... how does the application discover the result of the prompt? 

```js
const permission = await navigator.permissions.query({name: "captured-surface-control"});
permission.onchange = () => console.log(`changed to ${permission.state}`);
```

> Is it a blocking prompt?

No.

---
<sub>1. By "synchronous" I mean the check is done in the synchronous part of the algorithm before going "in parallel". The "rejected" state is synchronously observable in web console upon function return.

-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/mediacapture-screen-share-extensions/issues/13#issuecomment-2436520091 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 24 October 2024 23:37:49 UTC