Re: [mediacapture-main] Allow ondevicechange to be fired before permission is granted or any device is opened

Here's a more concrete suggestion:

Require that changes to the set of enumerated devices is delayed, and 
that the result of enumerateDevices is cached for the same period.  
This need not be a significant time, just enough to create some 
uncertainty about cross-origin correlation.  This time should be 
reduced, perhaps to zero, for both origins with `list-devices` 
permissions as well as any foreground top-level browsing context (on 
the basis that connecting a device is analogous to a key stroke in 
this case).

Personally, I would only make the event/change available immediately 
to a foreground site and let the rest wait.  You might want to reduce 
the delay when switching tabs if the delay is significant.

I will note that this has a fairly obvious workaround/attack if it is 
poorly implemented: reload or make a new realm and call 
enumerateDevices to get a new value.  Thus, any timing information 
needs to be stored for origins (and periodically cleansed).

-- 
GitHub Notification of comment by martinthomson
Please view or discuss this issue at 
https://github.com/w3c/mediacapture-main/issues/402#issuecomment-250352996
 using your GitHub account

Received on Thursday, 29 September 2016 02:14:04 UTC