Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable content-blocking on all sites #76

Merged
merged 3 commits into from
Sep 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions vanadium_patches/0156-enable-subresource-filter-on-all-sites.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zoraver Kang <[email protected]>
Date: Thu, 22 Aug 2019 01:24:00 -0400
Subject: [PATCH] enable subresource filter on all sites

---
.../core/browser/subresource_filter_features.cc | 13 ++++++++++++-
.../core/browser/subresource_filter_features.h | 2 ++
2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/components/subresource_filter/core/browser/subresource_filter_features.cc b/components/subresource_filter/core/browser/subresource_filter_features.cc
index 0453cf5c49d87..56b9f8e1d4610 100644
--- a/components/subresource_filter/core/browser/subresource_filter_features.cc
+++ b/components/subresource_filter/core/browser/subresource_filter_features.cc
@@ -133,7 +133,9 @@ std::vector<Configuration> FillEnabledPresetConfigurations(
{kPresetPerformanceTestingDryRunOnAllSites, ad_tagging_enabled,
&Configuration::MakePresetForPerformanceTestingDryRunOnAllSites},
{kPresetLiveRunForBetterAds, true,
- &Configuration::MakePresetForLiveRunForBetterAds}};
+ &Configuration::MakePresetForLiveRunForBetterAds},
+ {kPresetLiveRunOnAllSites, true,
+ &Configuration::MakePresetForLiveRunOnAllSites}};

CommaSeparatedStrings enabled_presets(
TakeVariationParamOrReturnEmpty(params, kEnablePresetsParameterName));
@@ -281,6 +283,7 @@ const char kPresetPerformanceTestingDryRunOnAllSites[] =
"performance_testing_dryrun_on_all_sites";
const char kPresetLiveRunForBetterAds[] =
"liverun_on_better_ads_violating_sites";
+const char kPresetLiveRunOnAllSites[] = "liverun_on_all_sites";

// Configuration --------------------------------------------------------------

@@ -311,6 +314,14 @@ Configuration Configuration::MakePresetForLiveRunForBetterAds() {
return config;
}

+// static
+Configuration Configuration::MakePresetForLiveRunOnAllSites() {
+ Configuration config(mojom::ActivationLevel::kEnabled,
+ ActivationScope::ALL_SITES);
+ config.activation_conditions.priority = 600;
+ return config;
+}
+
Configuration::Configuration() = default;
Configuration::Configuration(mojom::ActivationLevel activation_level,
ActivationScope activation_scope,
diff --git a/components/subresource_filter/core/browser/subresource_filter_features.h b/components/subresource_filter/core/browser/subresource_filter_features.h
index 22f56f69d0d31..8fb68c0ca0dfc 100644
--- a/components/subresource_filter/core/browser/subresource_filter_features.h
+++ b/components/subresource_filter/core/browser/subresource_filter_features.h
@@ -125,6 +125,7 @@ struct Configuration {
static Configuration MakePresetForLiveRunOnPhishingSites();
static Configuration MakePresetForPerformanceTestingDryRunOnAllSites();
static Configuration MakePresetForLiveRunForBetterAds();
+ static Configuration MakePresetForLiveRunOnAllSites();

ActivationConditions activation_conditions;
ActivationOptions activation_options;
@@ -231,6 +232,7 @@ extern const char kDisablePresetsParameterName[];
extern const char kPresetLiveRunOnPhishingSites[];
extern const char kPresetPerformanceTestingDryRunOnAllSites[];
extern const char kPresetLiveRunForBetterAds[];
+extern const char kPresetLiveRunOnAllSites[];

} // namespace subresource_filter