mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Bug 1733556 - Perform Permissions Policy check in navigator.permissions.query for "storage-access" - r=anti-tracking-reviewers,pbz
Differential Revision: https://phabricator.services.mozilla.com/D182374
This commit is contained in:
parent
7b05b40061
commit
bd24eefece
@ -9,6 +9,7 @@
|
||||
#include "mozilla/AntiTrackingUtils.h"
|
||||
#include "mozilla/dom/WindowGlobalChild.h"
|
||||
#include "mozilla/dom/BrowsingContext.h"
|
||||
#include "mozilla/dom/FeaturePolicyUtils.h"
|
||||
#include "mozilla/dom/PermissionStatus.h"
|
||||
#include "mozilla/dom/PermissionStatusBinding.h"
|
||||
|
||||
@ -48,6 +49,13 @@ StorageAccessPermissionStatus::UpdateState() {
|
||||
return SimplePromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
|
||||
}
|
||||
|
||||
// Perform a Permission Policy Request
|
||||
if (!FeaturePolicyUtils::IsFeatureAllowed(window->GetExtantDoc(),
|
||||
u"storage-access"_ns)) {
|
||||
mState = PermissionState::Prompt;
|
||||
return SimplePromise::CreateAndResolve(NS_OK, __func__);
|
||||
}
|
||||
|
||||
RefPtr<StorageAccessPermissionStatus> self(this);
|
||||
return wgc->SendHasStorageAccessPermission()->Then(
|
||||
GetMainThreadSerialEventTarget(), __func__,
|
||||
|
Loading…
Reference in New Issue
Block a user