Bug 1577199 apply speaker-selection feature policy r=jib
Differential Revision: https://phabricator.services.mozilla.com/D119867
This commit is contained in:
@@ -71,6 +71,7 @@
|
||||
#include "mozilla/dom/BlobURLProtocolHandler.h"
|
||||
#include "mozilla/dom/ContentMediaController.h"
|
||||
#include "mozilla/dom/ElementInlines.h"
|
||||
#include "mozilla/dom/FeaturePolicyUtils.h"
|
||||
#include "mozilla/dom/HTMLAudioElement.h"
|
||||
#include "mozilla/dom/HTMLInputElement.h"
|
||||
#include "mozilla/dom/HTMLMediaElementBinding.h"
|
||||
@@ -7492,6 +7493,12 @@ already_AddRefed<Promise> HTMLMediaElement::SetSinkId(const nsAString& aSinkId,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!FeaturePolicyUtils::IsFeatureAllowed(win->GetExtantDoc(),
|
||||
u"speaker-selection"_ns)) {
|
||||
promise->MaybeRejectWithNotAllowedError(
|
||||
"Document's Permissions Policy does not allow setSinkId()");
|
||||
}
|
||||
|
||||
if (mSink.first.Equals(aSinkId)) {
|
||||
promise->MaybeResolveWithUndefined();
|
||||
return promise.forget();
|
||||
|
||||
Reference in New Issue
Block a user