-
Notifications
You must be signed in to change notification settings - Fork 901
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from brave/3rd_party_fingerprinting
3rd party fingerprinting protection
- Loading branch information
Showing
15 changed files
with
368 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
source_set("browser") { | ||
sources = [ | ||
"brave_host_content_settings_map.cc", | ||
"brave_host_content_settings_map.h", | ||
] | ||
|
||
deps = [ | ||
] | ||
|
||
public_deps = [ | ||
] | ||
} |
29 changes: 29 additions & 0 deletions
29
components/content_settings/core/browser/brave_host_content_settings_map.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "brave/components/content_settings/core/browser/brave_host_content_settings_map.h" | ||
|
||
#include "components/content_settings/core/common/content_settings_pattern.h" | ||
|
||
BraveHostContentSettingsMap::BraveHostContentSettingsMap( | ||
PrefService* prefs, | ||
bool is_incognito_profile, | ||
bool is_guest_profile, | ||
bool store_last_modified) | ||
: HostContentSettingsMap(prefs, is_incognito_profile, is_guest_profile, | ||
store_last_modified) { | ||
InitializeFingerprintingContentSetting(); | ||
} | ||
|
||
BraveHostContentSettingsMap::~BraveHostContentSettingsMap() { | ||
} | ||
|
||
void BraveHostContentSettingsMap::InitializeFingerprintingContentSetting() { | ||
SetContentSettingCustomScope( | ||
ContentSettingsPattern::Wildcard(), | ||
ContentSettingsPattern::FromString("https://firstParty/*"), | ||
CONTENT_SETTINGS_TYPE_PLUGINS, | ||
"fingerprinting", | ||
CONTENT_SETTING_ALLOW); | ||
} |
21 changes: 21 additions & 0 deletions
21
components/content_settings/core/browser/brave_host_content_settings_map.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#ifndef BRAVE_COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_BRAVE_HOST_CONTENT_SETTINGS_MAP_H_ | ||
#define BRAVE_COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_BRAVE_HOST_CONTENT_SETTINGS_MAP_H_ | ||
|
||
#include "components/content_settings/core/browser/host_content_settings_map.h" | ||
|
||
class BraveHostContentSettingsMap : public HostContentSettingsMap { | ||
public: | ||
BraveHostContentSettingsMap(PrefService* prefs, | ||
bool is_incognito_profile, | ||
bool is_guest_profile, | ||
bool store_last_modified); | ||
private: | ||
void InitializeFingerprintingContentSetting(); | ||
~BraveHostContentSettingsMap() override; | ||
}; | ||
|
||
#endif // BRAVE_COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_BRAVE_HOST_CONTENT_SETTINGS_MAP_H_ |
21 changes: 21 additions & 0 deletions
21
patches/chrome-browser-content_settings-host_content_settings_map_factory.cc.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
diff --git a/chrome/browser/content_settings/host_content_settings_map_factory.cc b/chrome/browser/content_settings/host_content_settings_map_factory.cc | ||
index 7bb265a57ba4c03489743add26adaeea40a9fb06..3f6b1af25a0118ac2b6d388948f0dee49d32f78a 100644 | ||
--- a/chrome/browser/content_settings/host_content_settings_map_factory.cc | ||
+++ b/chrome/browser/content_settings/host_content_settings_map_factory.cc | ||
@@ -7,6 +7,7 @@ | ||
#include <utility> | ||
|
||
#include "base/feature_list.h" | ||
+#include "brave/components/content_settings/core/browser/brave_host_content_settings_map.h" | ||
#include "chrome/browser/profiles/off_the_record_profile_impl.h" | ||
#include "chrome/browser/profiles/profile.h" | ||
#include "chrome/common/chrome_features.h" | ||
@@ -81,7 +82,7 @@ scoped_refptr<RefcountedKeyedService> | ||
|
||
bool store_last_modified = base::FeatureList::IsEnabled(features::kTabsInCbd); | ||
|
||
- scoped_refptr<HostContentSettingsMap> settings_map(new HostContentSettingsMap( | ||
+ scoped_refptr<HostContentSettingsMap> settings_map(new BraveHostContentSettingsMap( | ||
profile->GetPrefs(), | ||
profile->GetProfileType() == Profile::INCOGNITO_PROFILE, | ||
profile->GetProfileType() == Profile::GUEST_PROFILE, |
27 changes: 0 additions & 27 deletions
27
patches/chrome-renderer-content_settings_observer.cc.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
patches/components-content_settings-core-browser-host_content_settings_map.h.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/components/content_settings/core/browser/host_content_settings_map.h b/components/content_settings/core/browser/host_content_settings_map.h | ||
index 890e8959ae155618b78661dc8e97a81332d654f8..2a1f562e3b37ce85c3de48ea3f753c34c8586bbd 100644 | ||
--- a/components/content_settings/core/browser/host_content_settings_map.h | ||
+++ b/components/content_settings/core/browser/host_content_settings_map.h | ||
@@ -303,6 +303,7 @@ class HostContentSettingsMap : public content_settings::Observer, | ||
} | ||
|
||
private: | ||
+ friend class BraveHostContentSettingsMap; | ||
friend class base::RefCountedThreadSafe<HostContentSettingsMap>; | ||
friend class content_settings::TestUtils; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.