зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1495359 - FeaturePolicy: encrypted-media, r=cpearce
This commit is contained in:
Родитель
dfb9eb8319
Коммит
99eef68114
|
@ -36,6 +36,7 @@
|
|||
#include "BatteryManager.h"
|
||||
#include "mozilla/dom/CredentialsContainer.h"
|
||||
#include "mozilla/dom/Clipboard.h"
|
||||
#include "mozilla/dom/FeaturePolicyUtils.h"
|
||||
#include "mozilla/dom/GamepadServiceTest.h"
|
||||
#include "mozilla/dom/MediaCapabilities.h"
|
||||
#include "mozilla/dom/WakeLock.h"
|
||||
|
@ -1721,6 +1722,14 @@ Navigator::RequestMediaKeySystemAccess(const nsAString& aKeySystem,
|
|||
ArrayLength(params));
|
||||
}
|
||||
|
||||
nsIDocument* doc = mWindow->GetExtantDoc();
|
||||
if (doc &&
|
||||
!FeaturePolicyUtils::IsFeatureAllowed(doc,
|
||||
NS_LITERAL_STRING("encrypted-media"))) {
|
||||
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<DetailedPromise> promise =
|
||||
DetailedPromise::Create(mWindow->AsGlobal(), aRv,
|
||||
NS_LITERAL_CSTRING("navigator.requestMediaKeySystemAccess"),
|
||||
|
|
|
@ -29,7 +29,6 @@ static FeatureMap sSupportedFeatures[] = {
|
|||
{ "autoplay", FeatureMap::eSelf },
|
||||
// TODO: not supported yet!!!
|
||||
{ "camera", FeatureMap::eSelf },
|
||||
// TODO: not supported yet!!!
|
||||
{ "encrypted-media", FeatureMap::eSelf },
|
||||
// TODO: not supported yet!!!
|
||||
{ "fullscreen", FeatureMap::eSelf },
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
prefs: [dom.security.featurePolicy.enabled:true]
|
||||
lsan-allowed: [Alloc, MakeUnique, Malloc, NewPage, Realloc, mozilla::EMEDecryptor::EMEDecryptor, mozilla::SchedulerGroup::CreateEventTargetFor, CreateCDMProxy, mozilla::dom::MediaKeys::CreateCDMProxy, mozilla::dom::nsIContentChild::GetConstructedEventTarget]
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
[clearkey-mp4-unique-origin.https.html]
|
||||
[Unique origin is unable to create MediaKeys]
|
||||
expected: FAIL
|
||||
|
|
@ -3,9 +3,6 @@
|
|||
[Default "encrypted-media" feature policy ["self"\] allows same-origin iframes.]
|
||||
expected: TIMEOUT
|
||||
|
||||
[Default "encrypted-media" feature policy ["self"\] disallows cross-origin iframes.]
|
||||
expected: FAIL
|
||||
|
||||
[Feature policy "encrypted-media" can be enabled in cross-origin iframes using "allow" attribute.]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче