Files
cromite/build/patches/Disable-FirstPartySets-and-StorageAccessAPI.patch
T

99 lines
5.6 KiB
Diff

From: uazo <uazo@users.noreply.github.com>
Date: Tue, 2 May 2023 15:26:46 +0000
Subject: Disable FirstPartySets and StorageAccessAPI
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
---
.../first_party_sets/first_party_sets_navigation_throttle.cc | 2 +-
.../first_party_sets/first_party_sets_policy_service.cc | 3 ++-
.../browser/privacy_sandbox/privacy_sandbox_service_impl.cc | 2 +-
components/privacy_sandbox/privacy_sandbox_prefs.cc | 2 +-
components/privacy_sandbox/tracking_protection_prefs.cc | 4 ++--
.../Disable-FirstPartySets-and-StorageAccessAPI.inc | 1 +
6 files changed, 8 insertions(+), 6 deletions(-)
create mode 100644 cromite_flags/third_party/blink/common/features_cc/Disable-FirstPartySets-and-StorageAccessAPI.inc
diff --git a/chrome/browser/first_party_sets/first_party_sets_navigation_throttle.cc b/chrome/browser/first_party_sets/first_party_sets_navigation_throttle.cc
--- a/chrome/browser/first_party_sets/first_party_sets_navigation_throttle.cc
+++ b/chrome/browser/first_party_sets/first_party_sets_navigation_throttle.cc
@@ -77,7 +77,7 @@ FirstPartySetsNavigationThrottle::MaybeCreateNavigationThrottle(
// The `service` might be null for some irregular profiles.
// TODO(crbug.com/40233408): regular profiles and guest sessions
// aren't mutually exclusive on ChromeOS.
- if (!profile->IsRegularProfile() || profile->IsGuestSession())
+ if (((true)) || !profile->IsRegularProfile() || profile->IsGuestSession())
return nullptr;
FirstPartySetsPolicyService* service =
diff --git a/chrome/browser/first_party_sets/first_party_sets_policy_service.cc b/chrome/browser/first_party_sets/first_party_sets_policy_service.cc
--- a/chrome/browser/first_party_sets/first_party_sets_policy_service.cc
+++ b/chrome/browser/first_party_sets/first_party_sets_policy_service.cc
@@ -59,6 +59,7 @@ const base::Value::Dict* GetOverridesPolicyForProfile(
}
ServiceState GetServiceState(Profile* profile, bool pref_enabled) {
+ if ((true)) return ServiceState::kPermanentlyDisabled;
if (profile->IsSystemProfile() || profile->IsGuestSession() ||
profile->IsOffTheRecord()) {
return ServiceState::kPermanentlyDisabled;
@@ -112,7 +113,7 @@ void FirstPartySetsPolicyService::Init() {
profile, profile->GetPrefs() &&
profile->GetPrefs()->GetBoolean(
prefs::kPrivacySandboxRelatedWebsiteSetsEnabled));
-
+ service_state_ = ServiceState::kPermanentlyDisabled;
if (service_state_ == ServiceState::kPermanentlyDisabled) {
OnReadyToNotifyDelegates(net::FirstPartySetsContextConfig(),
net::FirstPartySetsCacheFilter());
diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc b/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc
--- a/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc
+++ b/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc
@@ -424,7 +424,7 @@ bool PrivacySandboxServiceImpl::IsRestrictedNoticeEnabled() {
void PrivacySandboxServiceImpl::SetFirstPartySetsDataAccessEnabled(
bool enabled) {
pref_service_->SetBoolean(prefs::kPrivacySandboxRelatedWebsiteSetsEnabled,
- enabled);
+ false);
}
bool PrivacySandboxServiceImpl::IsFirstPartySetsDataAccessEnabled() const {
diff --git a/components/privacy_sandbox/privacy_sandbox_prefs.cc b/components/privacy_sandbox/privacy_sandbox_prefs.cc
--- a/components/privacy_sandbox/privacy_sandbox_prefs.cc
+++ b/components/privacy_sandbox/privacy_sandbox_prefs.cc
@@ -48,7 +48,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(
prefs::kPrivacySandboxFirstPartySetsDataAccessAllowedInitialized, false);
registry->RegisterBooleanPref(
- prefs::kPrivacySandboxRelatedWebsiteSetsEnabled, true,
+ prefs::kPrivacySandboxRelatedWebsiteSetsEnabled, false, // must be disabled
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(prefs::kPrivacySandboxTopicsConsentGiven,
diff --git a/components/privacy_sandbox/tracking_protection_prefs.cc b/components/privacy_sandbox/tracking_protection_prefs.cc
--- a/components/privacy_sandbox/tracking_protection_prefs.cc
+++ b/components/privacy_sandbox/tracking_protection_prefs.cc
@@ -64,14 +64,14 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
// Tracking Protection Settings Prefs
registry->RegisterBooleanPref(
- prefs::kBlockAll3pcToggleEnabled, false,
+ prefs::kBlockAll3pcToggleEnabled, false, // with true enables FPS
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(prefs::kAllowAll3pcToggleEnabled, false);
registry->RegisterIntegerPref(
prefs::kTrackingProtectionLevel,
static_cast<int>(TrackingProtectionLevel::kStandard),
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kTrackingProtection3pcdEnabled, false);
+ registry->RegisterBooleanPref(prefs::kTrackingProtection3pcdEnabled, false); // with true enables FPS
registry->RegisterBooleanPref(
prefs::kIpProtectionEnabled, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
diff --git a/cromite_flags/third_party/blink/common/features_cc/Disable-FirstPartySets-and-StorageAccessAPI.inc b/cromite_flags/third_party/blink/common/features_cc/Disable-FirstPartySets-and-StorageAccessAPI.inc
new file mode 100644
--- /dev/null
+++ b/cromite_flags/third_party/blink/common/features_cc/Disable-FirstPartySets-and-StorageAccessAPI.inc
@@ -0,0 +1 @@
+SET_CROMITE_FEATURE_DISABLED(kSharedStorageAPI);
--