Re: [mediacapture-screen-share] Add getCurrentBrowsingContextMedia (#148)

> a confirmation-only dialog is displayed if all of the new security requirements are satisfied, and an explicit-selection dialog is shown otherwise, ... but offers tabs as the first option if gVM-fallback-mode is used.)

This would make _getViewportMedia_ a weakened version of _getDisplayMedia_, which seems problematic.

I don't think we can infer that an app calling one API wants to fall back to calling the other in all circumstances. This seems app-specific, and a few lines of code:
```js
let stream;
try {
  stream = await navigator.mediaDevices.getViewportMedia();
} catch (e) {
  if (e.name != "SecurityError") throw;
  stream = await navigator.mediaDevices.getDisplayMedia(); // ยน
}
```
This would be well-tested, because as you say: _"we expect this to happen >99% of the time, at least in the early days"_.

---
<sub>1) If Chrome wants to weaken the already strained security properties of *getDisplayMedia*, it can do so here without melding APIs together, by ignoring [spec recommendations](https://w3c.github.io/mediacapture-screen-share/#elevated-permissions) and detecting this situation.</sub>






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


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

Received on Thursday, 25 March 2021 20:30:28 UTC