It would be bad for trust-store to aggregate arbitrary permission
requests into a single prompt, because that would make it easier for
apps to get away with asking for permissions that they shouldn’t have.
For example, a maps app that asks for access to your contacts at exactly
the same time as it asks for access to your location. As long as the
prompts are separate, people are much less likely to allow access to
something the app shouldn’t need.

Now, with video and microphone, we’ve made a policy decision that if an
app asks for the first it automatically gets the second. I guess trust-
store *could* implement this policy just by aggregating just those two
prompts itself. That seems a bit brittle, though: it would mean whether
you got one prompt or two would depend on how fast the device was
running, and whether the requests happened on different threads. More
importantly, it would mean native (non-Web) apps would still need two
permissions for recording video+audio, when really they should need only
one.

So the reason I’m asking whether the Web APIs are asynchronous is that
if they are, Oxide could handle this itself. Excuse my comically
incorrect pseudocode, but something like:

siteAsksForVideo() {
    if(browserHasEitherPermissionYet) {
         startRecordingVideo(); // zero or one trust-store prompt immediately
    } else {
        try {
            wait(2 seconds);
        } catch (SiteAsksForMicrophone) {
            startRecordingVideoAndMicrophone(); // triggers the combined prompt
        } finally {
            startRecordingVideo(); // triggers the microphone-only prompt
        }
    }
}

siteAsksForMicrophone() {
    if(browserHasEitherPermissionYet) {
         startRecordingMicrophone(); // zero or one trust-store prompt 
immediately
    } else {
        try {
            wait(2 seconds);
        } catch (SiteAsksForVideo) {
            startRecordingVideoAndMicrophone(); // triggers the combined prompt
        } finally {
            startRecordingMicrophone(); // triggers the microphone-only prompt
        }
    }
}

So the first time you ever used the browser with a site that used
video/microphone, it would block for two seconds waiting to see if the
site asked for the other one too. Every subsequent time, it would try to
access the camera/microphone immediately as normal.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1554149

Title:
  Asks for separate permission for microphone and camera

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/trust-store/+bug/1554149/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to