diff --git a/build/bromite_patches_list.txt b/build/bromite_patches_list.txt index 6d992f22..fc73b2e8 100644 --- a/build/bromite_patches_list.txt +++ b/build/bromite_patches_list.txt @@ -198,7 +198,6 @@ Add-kill-switch-for-unsupported-clangd-flags.patch 00AdblockPlus.patch 00Eyeo-Adblock-Remove-Privacy-Issues.patch -00WIN-Add-adblock-plus-setting-page.patch 00WIN-ADDTO-Eyeo-Adblock.patch 00WIN-ADDTO-Add-an-always-incognito-mode.patch @@ -276,4 +275,5 @@ AudioBuffer-AnalyserNode-fp-mitigations.patch 00Remove-https-connection-from-chrome-discards.patch 00Add-a-flag-to-disable-GamePad-API.patch 00Disable-WebGPU.patch +00Disable-FirstPartySets-and-StorageAccessAPI.patch 00v113-temp-fix-build.patch \ No newline at end of file diff --git a/build/patches/00Disable-FirstPartySets-and-StorageAccessAPI.patch b/build/patches/00Disable-FirstPartySets-and-StorageAccessAPI.patch new file mode 100644 index 00000000..ec61993a --- /dev/null +++ b/build/patches/00Disable-FirstPartySets-and-StorageAccessAPI.patch @@ -0,0 +1,39 @@ +From: uazo +Date: Tue, 2 May 2023 15:26:46 +0000 +Subject: Disable FirstPartySets and StorageAccessAPI + +--- + components/privacy_sandbox/privacy_sandbox_prefs.cc | 2 +- + content/public/common/content_features.cc | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +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 +@@ -147,7 +147,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) { + registry->RegisterBooleanPref( + prefs::kPrivacySandboxFirstPartySetsDataAccessAllowedInitialized, false); + registry->RegisterBooleanPref( +- prefs::kPrivacySandboxFirstPartySetsEnabled, true, ++ prefs::kPrivacySandboxFirstPartySetsEnabled, false, + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); + + registry->RegisterBooleanPref(prefs::kPrivacySandboxTopicsConsentGiven, +diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc +--- a/content/public/common/content_features.cc ++++ b/content/public/common/content_features.cc +@@ -465,9 +465,9 @@ BASE_FEATURE(kWebIdentityMDocs, + base::FEATURE_DISABLED_BY_DEFAULT); + + // Enables usage of First Party Sets to determine cookie availability. +-BASE_FEATURE(kFirstPartySets, +- "FirstPartySets", +- base::FEATURE_DISABLED_BY_DEFAULT); ++BASE_FEATURE(kFirstPartySets, // always ++ "FirstPartySets", // disabled ++ base::FEATURE_DISABLED_BY_DEFAULT); // in bromite + + // Controls whether to clear sites data on FPS transitions. + const base::FeatureParam kFirstPartySetsClearSiteDataOnChangedSets{ +-- +2.25.1 diff --git a/build/patches/00Eyeo-Adblock-Remove-Privacy-Issues.patch b/build/patches/00Eyeo-Adblock-Remove-Privacy-Issues.patch index 6c33366c..74c0ad53 100644 --- a/build/patches/00Eyeo-Adblock-Remove-Privacy-Issues.patch +++ b/build/patches/00Eyeo-Adblock-Remove-Privacy-Issues.patch @@ -1,8 +1,9 @@ -From: Your Name +From: uazo Date: Thu, 29 Sep 2022 11:27:35 +0000 Subject: Eyeo Adblock Remove ---- +Removes some functions from AdBlock Plus and adds +settings ui in Windows--- .../android/java/res/xml/main_preferences.xml | 11 +- chrome/browser/BUILD.gn | 2 - .../adblock/adblock_content_browser_client.cc | 17 - @@ -11,6 +12,16 @@ Subject: Eyeo Adblock Remove .../adblock_telemetry_service_factory.h | 56 - .../adblock/subscription_service_factory.cc | 2 +- ...hrome_browser_main_extra_parts_profiles.cc | 2 - + chrome/browser/resources/settings/BUILD.gn | 2 + + .../settings/adblock_page/adblock_page.html | 185 + + .../settings/adblock_page/adblock_page.ts | 210 ++ + .../settings/basic_page/basic_page.html | 7 + + .../settings/basic_page/basic_page.ts | 1 + + .../resources/settings/page_visibility.ts | 1 + + chrome/browser/resources/settings/route.ts | 4 + + chrome/browser/resources/settings/router.ts | 1 + + chrome/browser/resources/settings/settings.ts | 1 + + .../settings/settings_menu/settings_menu.html | 5 + chrome/browser/ui/tab_helpers.cc | 2 + chrome/test/BUILD.gn | 1 - components/adblock/android/BUILD.gn | 2 +- @@ -32,10 +43,11 @@ Subject: Eyeo Adblock Remove .../adblock/core/common/adblock_prefs.cc | 44 +- .../adblock/core/common/adblock_utils.cc | 23 - .../adblock/core/converter/parser/metadata.cc | 6 +- + .../core/converter/parser/url_filter.cc | 4 + .../adblock/core/sitekey_storage_impl.cc | 6 + ...filtering_configuration_maintainer_impl.cc | 10 - .../filtering_configuration_maintainer_impl.h | 1 - - .../ongoing_subscription_request_impl.cc | 27 +- + .../ongoing_subscription_request_impl.cc | 31 +- .../preloaded_subscription_provider_impl.cc | 4 +- .../core/subscription/subscription_config.cc | 8 +- .../subscription_downloader_impl.cc | 15 +- @@ -53,9 +65,11 @@ Subject: Eyeo Adblock Remove .../blink/renderer/core/css/style_engine.cc | 8 + .../blink/renderer/core/css/style_engine.h | 1 + .../renderer/core/exported/web_document.cc | 13 +- - 50 files changed, 3290 insertions(+), 1147 deletions(-) + 61 files changed, 3712 insertions(+), 1150 deletions(-) delete mode 100644 chrome/browser/adblock/adblock_telemetry_service_factory.cc delete mode 100644 chrome/browser/adblock/adblock_telemetry_service_factory.h + create mode 100644 chrome/browser/resources/settings/adblock_page/adblock_page.html + create mode 100644 chrome/browser/resources/settings/adblock_page/adblock_page.ts rename components/adblock/android/java/res/xml/{adblock_preferences.xml => eyeo_adblock_preferences.xml} (100%) delete mode 100644 components/adblock/core/activeping_telemetry_topic_provider.cc delete mode 100644 components/adblock/core/activeping_telemetry_topic_provider.h @@ -367,6 +381,520 @@ diff --git a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc adblock::ContentSecurityPolicyInjectorFactory::GetInstance(); adblock::ElementHiderFactory::GetInstance(); adblock::ResourceClassificationRunnerFactory::GetInstance(); +diff --git a/chrome/browser/resources/settings/BUILD.gn b/chrome/browser/resources/settings/BUILD.gn +--- a/chrome/browser/resources/settings/BUILD.gn ++++ b/chrome/browser/resources/settings/BUILD.gn +@@ -72,6 +72,7 @@ build_webui("build") { + "a11y_page/a11y_page.ts", + "a11y_page/live_caption_section.ts", + "about_page/about_page.ts", ++ "adblock_page/adblock_page.ts", + "appearance_page/appearance_fonts_page.ts", + "appearance_page/appearance_page.ts", + "appearance_page/home_url_input.ts", +@@ -390,6 +391,7 @@ build_webui("build") { + ts_composite = true + ts_definitions = [ + "//tools/typescript/definitions/autofill_private.d.ts", ++ "//tools/typescript/definitions/adblock_private.d.ts", + "//tools/typescript/definitions/chrome_send.d.ts", + "//tools/typescript/definitions/language_settings_private.d.ts", + "//tools/typescript/definitions/management.d.ts", +diff --git a/chrome/browser/resources/settings/adblock_page/adblock_page.html b/chrome/browser/resources/settings/adblock_page/adblock_page.html +new file mode 100644 +--- /dev/null ++++ b/chrome/browser/resources/settings/adblock_page/adblock_page.html +@@ -0,0 +1,185 @@ ++ ++ ++ ++ ++ ++ ++
++
++ ++
++ Built in Subscriptions ++
++
++ ++
++ ++
++
++ ++
++
++
++
++ ++
++ Allowed Domains ++
++
++ ++
++ ++
++
++ ++
++
++ ++ ++ Add ++ ++ ++
++
++
++
++
++
++ ++
++ Custom Subscriptions ++
++
++ ++
++ ++
++
++ ++
++
++ ++ ++ Add ++ ++ ++
++
++
++
++
++
++ ++
++ Custom Filters ++
++
++ ++
++ ++
++
++ ++
++
++ ++ ++ Add ++ ++ ++
++
++
++
++
++ ++
+diff --git a/chrome/browser/resources/settings/adblock_page/adblock_page.ts b/chrome/browser/resources/settings/adblock_page/adblock_page.ts +new file mode 100644 +--- /dev/null ++++ b/chrome/browser/resources/settings/adblock_page/adblock_page.ts +@@ -0,0 +1,210 @@ ++/* ++ This file is part of Bromite. ++ ++ Bromite is free software: you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation, either version 3 of the License, or ++ (at your option) any later version. ++ ++ Bromite is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with Bromite. If not, see . ++*/ ++import 'chrome://resources/cr_elements/cr_button/cr_button.js'; ++import 'chrome://resources/cr_elements/cr_shared_style.css.js'; ++import 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js'; ++import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; ++import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; ++import '../controls/controlled_button.js'; ++import '../controls/settings_toggle_button.js'; ++import '../settings_shared.css.js'; ++ ++ ++import { I18nMixin } from 'chrome://resources/cr_elements/i18n_mixin.js'; ++import { BaseMixin } from '../base_mixin.js'; ++import { PolymerElement } from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; ++import { SettingsToggleButtonElement } from '../controls/settings_toggle_button.js'; ++import { PrefsMixin } from '../prefs/prefs_mixin.js'; ++import { CrCheckboxElement } from 'chrome://resources/cr_elements/cr_checkbox/cr_checkbox.js'; ++import { getTemplate } from './adblock_page.html.js'; ++ ++ ++const SettingsAdblockPageElementBase = ++ I18nMixin(PrefsMixin(BaseMixin((PolymerElement)))); ++ ++interface Subscription { ++ url: string; ++ title: string; ++ enabled: boolean; ++} ++ ++export class SettingsAdblockPageElement extends ++ SettingsAdblockPageElementBase { ++ static get is() { ++ return 'settings-adblock-page'; ++ } ++ ++ static get template() { ++ return getTemplate(); ++ } ++ ++ // input fields updated by html ++ public customSubscriptionInput: string; ++ public customFilterInput: string; ++ public allowedDomainInput: string; ++ ++ // models that will fill templates lists in html ++ public customSubscriptions: Array = []; ++ public customFilters: Array = []; ++ public allowedDomains: Array = []; ++ public subscriptions: Subscription[] = []; ++ ++ private syncSubscriptions() { ++ this.subscriptions = [] ++ this.customSubscriptions = []; ++ ++ chrome.adblockPrivate.getBuiltInSubscriptions(list => { ++ chrome.adblockPrivate.getInstalledSubscriptions(activelist => { ++ let new_subscriptions: Subscription[] = []; ++ let custom_subscriptions: string[] = []; ++ ++ list.forEach(obj => { ++ new_subscriptions.push({ ++ title: obj.title, ++ enabled: false, ++ url: obj.url ++ }) ++ }) ++ ++ activelist.forEach(obj => { ++ var found = new_subscriptions.find(element => element.url == obj.url); ++ if (found != undefined) { ++ found.enabled = true; ++ } else { ++ custom_subscriptions.push(obj.url) ++ } ++ }) ++ ++ this.subscriptions = new_subscriptions; ++ this.customSubscriptions = custom_subscriptions; ++ }) ++ }); ++ } ++ ++ private syncCustomFilters() { ++ chrome.adblockPrivate.getCustomFilters(domain => { ++ this.customFilters = []; ++ domain.forEach(value => { ++ this.customFilters.push(value); ++ }) ++ }); ++ } ++ ++ private syncAllowedDomains() { ++ chrome.adblockPrivate.getAllowedDomains(domain => { ++ this.allowedDomains = []; ++ domain.forEach(value => { ++ this.allowedDomains.push(value); ++ }) ++ }); ++ } ++ ++ public override ready() { ++ super.ready(); ++ ++ this.syncSubscriptions(); ++ this.syncCustomFilters(); ++ this.syncAllowedDomains(); ++ } ++ ++ private onAdblockEnabled_(event: Event) { ++ if ((event.target as SettingsToggleButtonElement).checked) { ++ chrome.adblockPrivate.setEnabled(true); ++ } else { ++ chrome.adblockPrivate.setEnabled(false); ++ } ++ } ++ ++ private cleanUrl(url: string) : string { ++ let cleanedUrl : string = ""; ++ try { ++ cleanedUrl = new URL(url).host; ++ } catch (err) { ++ try { ++ // one last try by adding schema ++ cleanedUrl = new URL("https://" + url).host; ++ } ++ catch (err) { ++ console.log("malformed url " + url); ++ } ++ } ++ return cleanedUrl; ++ } ++ ++ private selectRecommendedSubscription(e: Event) { ++ const url = ((e.target as CrCheckboxElement).id); ++ const enabled = ((e.target as CrCheckboxElement).checked); ++ if (enabled) { ++ chrome.adblockPrivate.installSubscription(url); ++ } else { ++ chrome.adblockPrivate.uninstallSubscription(url); ++ } ++ } ++ ++ private removeCustomFilter(e: Event) { ++ const filter = ((e.target as HTMLElement).id); ++ chrome.adblockPrivate.removeCustomFilter(filter); ++ const i = this.customFilters.indexOf(filter); ++ this.splice('customFilters', i, 1); ++ } ++ ++ private addCustomFilter() { ++ if (this.customFilterInput == undefined || this.customFilterInput == "") return; ++ chrome.adblockPrivate.addCustomFilter(this.customFilterInput); ++ this.customFilterInput = ""; ++ this.syncCustomFilters(); ++ } ++ ++ private removeAllowedDomain(e: Event) { ++ const allowedDomain = ((e.target as HTMLElement).id); ++ chrome.adblockPrivate.removeAllowedDomain(allowedDomain); ++ const i = this.allowedDomains.indexOf(allowedDomain); ++ this.splice('allowedDomains', i, 1); ++ } ++ ++ private addAllowedDomain() { ++ if (this.allowedDomainInput == undefined || this.allowedDomainInput == "") return; ++ const cleanedUrl = this.cleanUrl(this.allowedDomainInput); ++ if (cleanedUrl == "") return; ++ chrome.adblockPrivate.addAllowedDomain(cleanedUrl); ++ this.allowedDomainInput = ""; ++ this.syncAllowedDomains(); ++ } ++ ++ private removeCustomSubscription(e: Event) { ++ const subscription = ((e.target as HTMLElement).id); ++ chrome.adblockPrivate.uninstallSubscription(subscription); ++ const i = this.customSubscriptions.indexOf(subscription); ++ this.splice('customSubscriptions', i, 1); ++ } ++ ++ private addCustomSubscription() { ++ if (this.customSubscriptionInput == undefined || this.customSubscriptionInput == "") return; ++ chrome.adblockPrivate.installSubscription(this.customSubscriptionInput); ++ this.customSubscriptionInput = ""; ++ this.syncSubscriptions(); ++ } ++} ++ ++declare global { ++ interface HTMLElementTagNameMap { ++ 'settings-adblock-page': SettingsAdblockPageElement; ++ } ++} ++ ++customElements.define( ++ SettingsAdblockPageElement.is, SettingsAdblockPageElement); +diff --git a/chrome/browser/resources/settings/basic_page/basic_page.html b/chrome/browser/resources/settings/basic_page/basic_page.html +--- a/chrome/browser/resources/settings/basic_page/basic_page.html ++++ b/chrome/browser/resources/settings/basic_page/basic_page.html +@@ -24,6 +24,13 @@ + + + ++ + -+ -