From b8b973a9f3377d053ee8ca093d10ad7b07ac740e Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Fri, 24 Mar 2023 15:58:28 +0100 Subject: [PATCH] Add patch description --- build/bromite_patches_list.txt | 2 +- .../00Disable-visited-pseudo-class.patch | 64 +++++++++++++++++++ .../00Fonts-fingerprinting-mitigation.patch | 12 +++- .../00WIP-disable-visited-pseudo-class.patch | 21 ------ 4 files changed, 76 insertions(+), 23 deletions(-) create mode 100644 build/patches/00Disable-visited-pseudo-class.patch delete mode 100644 build/patches/00WIP-disable-visited-pseudo-class.patch diff --git a/build/bromite_patches_list.txt b/build/bromite_patches_list.txt index e05276c0..1df8de89 100644 --- a/build/bromite_patches_list.txt +++ b/build/bromite_patches_list.txt @@ -312,7 +312,7 @@ AudioBuffer-AnalyserNode-fp-mitigations.patch 00Disable-FedCm.patch 00Disable-BackForwardCache.patch 00Evict-the-entire-FrameTree-like-desktop.patch -00WIP-disable-visited-pseudo-class.patch +00Disable-visited-pseudo-class.patch 00Add-setting-to-clear-data-on-exit.patch 00WIN-Disable-sharing-hub.patch 00WIN-Enable-Network-Service-Sandbox-and-CIG.patch diff --git a/build/patches/00Disable-visited-pseudo-class.patch b/build/patches/00Disable-visited-pseudo-class.patch new file mode 100644 index 00000000..9e7c5894 --- /dev/null +++ b/build/patches/00Disable-visited-pseudo-class.patch @@ -0,0 +1,64 @@ +From: uazo +Date: Tue, 14 Feb 2023 16:41:42 +0000 +Subject: Disable visited pseudo class + +Disable support for pseduo css visited class +--- + components/visitedlink/browser/visitedlink_writer.cc | 8 ++++---- + components/visitedlink/common/visitedlink_common.cc | 1 + + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/components/visitedlink/browser/visitedlink_writer.cc b/components/visitedlink/browser/visitedlink_writer.cc +--- a/components/visitedlink/browser/visitedlink_writer.cc ++++ b/components/visitedlink/browser/visitedlink_writer.cc +@@ -221,7 +221,7 @@ VisitedLinkWriter::VisitedLinkWriter(content::BrowserContext* browser_context, + : browser_context_(browser_context), + delegate_(delegate), + listener_(std::make_unique(browser_context)), +- persist_to_disk_(persist_to_disk) {} ++ persist_to_disk_(false) {} + + VisitedLinkWriter::VisitedLinkWriter(Listener* listener, + VisitedLinkDelegate* delegate, +@@ -231,10 +231,10 @@ VisitedLinkWriter::VisitedLinkWriter(Listener* listener, + int32_t default_table_size) + : delegate_(delegate), + listener_(listener), +- persist_to_disk_(persist_to_disk), ++ persist_to_disk_(false), + database_name_override_(filename), + table_size_override_(default_table_size), +- suppress_rebuild_(suppress_rebuild) { ++ suppress_rebuild_(false) { + DCHECK(listener_); + } + +@@ -302,6 +302,7 @@ void VisitedLinkWriter::AddURL(const GURL& url, bool update_file) { + } + + VisitedLinkWriter::Hash VisitedLinkWriter::TryToAddURL(const GURL& url) { ++ if ((true)) return null_hash_; + // Extra check that we are not incognito. This should not happen. + // TODO(boliu): Move this check to HistoryService when IsOffTheRecord is + // removed from BrowserContext. +@@ -1021,7 +1022,6 @@ bool VisitedLinkWriter::RebuildTableFromDelegate() { + + // TODO(brettw) make sure we have reasonable salt! + table_builder_ = new TableBuilder(this, salt_); +- delegate_->RebuildTable(table_builder_); + return true; + } + +diff --git a/components/visitedlink/common/visitedlink_common.cc b/components/visitedlink/common/visitedlink_common.cc +--- a/components/visitedlink/common/visitedlink_common.cc ++++ b/components/visitedlink/common/visitedlink_common.cc +@@ -43,6 +43,7 @@ bool VisitedLinkCommon::IsVisited(const GURL& url) const { + } + + bool VisitedLinkCommon::IsVisited(Fingerprint fingerprint) const { ++ if ((true)) return false; + // Go through the table until we find the item or an empty spot (meaning it + // wasn't found). This loop will terminate as long as the table isn't full, + // which should be enforced by AddFingerprint. +-- +2.25.1 diff --git a/build/patches/00Fonts-fingerprinting-mitigation.patch b/build/patches/00Fonts-fingerprinting-mitigation.patch index c668e61b..cf1448f6 100644 --- a/build/patches/00Fonts-fingerprinting-mitigation.patch +++ b/build/patches/00Fonts-fingerprinting-mitigation.patch @@ -1,7 +1,17 @@ -From: Your Name +From: uazo Date: Wed, 1 Mar 2023 15:37:55 +0000 Subject: Fonts fingerprinting mitigation +The patch disables the use of non-standard fonts by blink, +used for device fingerprinting. +Access to local fonts and downloading fonts via Android +Downloadable Fonts API is disabled. +In windows, the patch exposes only fonts from the default +installation based on the user language exposed to the websites, +eliminating the ability to retrieve fonts handled differently +by gdi and directwrite. +It is possible to restore the original behavior via the +fonts-fingerprint-mitigation flag, which is active by default. --- chrome/browser/about_flags.cc | 5 + chrome/browser/flag_descriptions.cc | 5 + diff --git a/build/patches/00WIP-disable-visited-pseudo-class.patch b/build/patches/00WIP-disable-visited-pseudo-class.patch deleted file mode 100644 index 3d66ee0d..00000000 --- a/build/patches/00WIP-disable-visited-pseudo-class.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Your Name -Date: Tue, 14 Feb 2023 16:41:42 +0000 -Subject: WIP disable visited pseudo class - ---- - components/visitedlink/common/visitedlink_common.cc | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/components/visitedlink/common/visitedlink_common.cc b/components/visitedlink/common/visitedlink_common.cc ---- a/components/visitedlink/common/visitedlink_common.cc -+++ b/components/visitedlink/common/visitedlink_common.cc -@@ -43,6 +43,7 @@ bool VisitedLinkCommon::IsVisited(const GURL& url) const { - } - - bool VisitedLinkCommon::IsVisited(Fingerprint fingerprint) const { -+ if ((true)) return false; - // Go through the table until we find the item or an empty spot (meaning it - // wasn't found). This loop will terminate as long as the table isn't full, - // which should be enforced by AddFingerprint. --- -2.25.1