From cc2cb172c335d3a99f4961a1e6d25017c37aa11b Mon Sep 17 00:00:00 2001 From: Adam Bergkvist Date: Wed, 10 Feb 2016 15:35:53 +0100 Subject: [PATCH] Check 'allowed to access user media' only for cross-origin iframes --- getusermedia.html | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/getusermedia.html b/getusermedia.html index 5372cf9b..cb96415a 100644 --- a/getusermedia.html +++ b/getusermedia.html @@ -2660,10 +2660,12 @@

MediaDevices Interface Extensions

"https://www.w3.org/TR/2015/WD-html51-20150506/browsers.html#browsing-context"> browsing context is a - nested browsing context which is not allowed to use user - media, return a promise rejected with a - DOMException object whose - name attribute has the value + nested browsing context whose origin is different from the + + top-level browsing context's origin and the nested browsing + context is not allowed to access user media, return a + promise rejected with a DOMException object + whose name attribute has the value SecurityError.

  • @@ -2891,19 +2893,19 @@

    NavigatorUserMediaErrorCallback

    User Media in an IFrame

    The topic of this section is under discussion and may be subject to change.
    -

    There are some special circumstances when an [[!HTML51]] +

    There are some special circumstances when a cross-origin [[!HTML51]] - iframe wants to access user media. The iframe needs explicit - permission from the embedding page and it needs to identify itself in the - security prompt presented to the user. This section, together with the - getUserMedia() algorithm, specifies that - behavior.

    + iframe wants to access user media. A cross-origin iframe needs + explicit permission from the embedding page and it needs to identify + itself in the security prompt presented to the user. This section, + together with the getUserMedia() algorithm, specifies + that behavior.

    The HTMLIFrameElement is extended with an allowusermedia content attribute. allowusermedia is a [[!HTML51]] boolean attribute. When specified, it indicates that scripts - in the iframe element's browsing context are allowed to use user + in the iframe element's browsing context are allowed to access user media (if it's not blocked for other reasons, e.g. there is another ancestor iframe without this attribute set).

    The iframe DOM interface is extended as described by the partial