зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1672649 - Part 2: Notify the observer when there is user-interaction or storage access permission added. r=dimi
We need to report when permission is added in order to wait it explicitly. These will be put be hind a pref 'privacy.antitracking.testing' and should be only used for testing. Differential Revision: https://phabricator.services.mozilla.com/D94979
This commit is contained in:
Родитель
b5a8e7ac7a
Коммит
442dee0715
|
@ -9168,6 +9168,14 @@
|
|||
value: 1800 # 30 minutes (in seconds)
|
||||
mirror: always
|
||||
|
||||
# Enable Anti-tracking testing. When it enables, it will notify the observers
|
||||
# when user-interaction permission or storage access permission is added. This
|
||||
# is for testing only.
|
||||
- name: privacy.antitracking.testing
|
||||
type: bool
|
||||
value: false
|
||||
mirror: always
|
||||
|
||||
# Enable the heuristic to allow storage access for recent visited pages
|
||||
- name: privacy.restrict3rdpartystorage.heuristic.recently_visited
|
||||
type: bool
|
||||
|
|
|
@ -724,6 +724,12 @@ ContentBlocking::SaveAccessForOriginOnParentProcess(
|
|||
expirationType, when);
|
||||
Unused << NS_WARN_IF(NS_FAILED(rv));
|
||||
|
||||
if (StaticPrefs::privacy_antitracking_testing()) {
|
||||
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
|
||||
obs->NotifyObservers(nullptr, "antitracking-test-storage-access-perm-added",
|
||||
nullptr);
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(rv) && (aAllowMode == eAllowAutoGrant)) {
|
||||
// Make sure temporary access grants do not survive more than 24 hours.
|
||||
TemporaryAccessGrantObserver::Create(permManager, aParentPrincipal, type);
|
||||
|
|
|
@ -51,6 +51,12 @@ void ContentBlockingUserInteraction::Observe(nsIPrincipal* aPrincipal) {
|
|||
nsIPermissionManager::ALLOW_ACTION,
|
||||
expirationType, when);
|
||||
Unused << NS_WARN_IF(NS_FAILED(rv));
|
||||
|
||||
if (StaticPrefs::privacy_antitracking_testing()) {
|
||||
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
|
||||
obs->NotifyObservers(
|
||||
nullptr, "antitracking-test-user-interaction-perm-added", nullptr);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче