W3C home > Mailing lists > Public > public-webrtc-logs@w3.org > October 2018

[mediacapture-main] NotAllowedError or SecurityError over Feature Policy?

From: Jan-Ivar Bruaroey via GitHub <sysbot+gh@w3.org>
Date: Wed, 10 Oct 2018 20:15:27 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issues.opened-368834279-1539202526-sysbot+gh@w3.org>
jan-ivar has just created a new issue for https://github.com/w3c/mediacapture-main:

== NotAllowedError or SecurityError over Feature Policy? ==
https://github.com/WICG/feature-policy does not mention "Error", but it's [explainer document](https://docs.google.com/document/d/1k0Ua-ZWlM_PsFCFdLMa8kaVTo32PeNZ4G7FFHqpFx4E/edit#) does:

*"The way that features get disabled varies from feature-to-feature. Permission-like features, such as geolocation, already fail sensibly and return error values when the permission to use it is missing. When such a feature is disabled by Feature Policy, it would be* ***equivalent to a denied permission*** *and would exercise a similar code path (perhaps* ***returning a different error code*** *)."*

But then [WPT](https://github.com/web-platform-tests/wpt/blob/master/mediacapture-streams/MediaStream-default-feature-policy.https.html#L40
) tests for `NotAllowedError`, which works in Chrome.

But then [getUserMedia](https://w3c.github.io/mediacapture-main/getusermedia.html#dom-mediadevices-getusermedia) says: *"If the current settings object's responsible document is NOT allowed to use the feature indicated by attribute name allowusermedia, return a promise rejected with a DOMException object whose name attribute has the value `SecurityError`."* (which is outdated and needs to point to the right place which is not `allowusermedia`)
But then Firefox Nightly [just merged](https://bugzilla.mozilla.org/show_bug.cgi?id=1497141) with `NotAllowedError` today, to match Chrome.

But then Chrome team just filed [issue 892042](https://bugs.chromium.org/p/chromium/issues/detail?id=892042) to switch to `SecurityError`.

What's best practice here? cc @annevk @alvestrand @guidou @bakulf

Please view or discuss this issue at https://github.com/w3c/mediacapture-main/issues/545 using your GitHub account
Received on Wednesday, 10 October 2018 20:15:28 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:22:07 UTC