Disable Web Bluetooth by default in desktop platforms: on desktop platforms, disable Bluetooth by default and activate the user-manageable content setting ui. (#1758)

This commit is contained in:
Carmelo Messina
2025-01-24 15:55:52 +01:00
parent 69ba260877
commit 6ceda90a2e
2 changed files with 40 additions and 0 deletions
@@ -0,0 +1,39 @@
From: uazo <uazo@users.noreply.github.com>
Date: Fri, 24 Jan 2025 14:32:14 +0000
Subject: Disable Web Bluetooth by default in desktop platforms
On desktop platforms, disable Bluetooth by default and activate the user-manageable content setting ui.
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
---
.../core/browser/content_settings_registry.cc | 5 +++++
.../content_features_cc/Disable-Web-Bluetooth-by-default.inc | 3 +++
2 files changed, 8 insertions(+)
create mode 100644 cromite_flags/content/public/common/content_features_cc/Disable-Web-Bluetooth-by-default.inc
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
--- a/components/content_settings/core/browser/content_settings_registry.cc
+++ b/components/content_settings/core/browser/content_settings_registry.cc
@@ -362,8 +362,13 @@ void ContentSettingsRegistry::Init() {
ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE,
ContentSettingsInfo::EXCEPTIONS_ON_SECURE_AND_INSECURE_ORIGINS);
+#if BUILDFLAG(IS_ANDROID)
Register(ContentSettingsType::BLUETOOTH_GUARD, "bluetooth-guard",
CONTENT_SETTING_ASK, WebsiteSettingsInfo::UNSYNCABLE,
+#else
+ Register(ContentSettingsType::BLUETOOTH_GUARD, "bluetooth-guard2",
+ CONTENT_SETTING_BLOCK, WebsiteSettingsInfo::UNSYNCABLE,
+#endif
/*allowlisted_primary_schemes=*/{},
/*valid_settings=*/{CONTENT_SETTING_ASK, CONTENT_SETTING_BLOCK},
WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE,
diff --git a/cromite_flags/content/public/common/content_features_cc/Disable-Web-Bluetooth-by-default.inc b/cromite_flags/content/public/common/content_features_cc/Disable-Web-Bluetooth-by-default.inc
new file mode 100644
--- /dev/null
+++ b/cromite_flags/content/public/common/content_features_cc/Disable-Web-Bluetooth-by-default.inc
@@ -0,0 +1,3 @@
+#if !BUILDFLAG(IS_ANDROID)
+SET_CROMITE_FEATURE_ENABLED(kWebBluetoothNewPermissionsBackend);
+#endif
--
+1
View File
@@ -48,6 +48,7 @@ Also disable gamepadconnected and gamepaddisconnected, see https://jshelter.org/
- (WINDOWS) Disable Windows ClearType Text Tuner setting (active in rdp sessions)
- (WINDOWS) Hide the presence of the webcam if the user has not given permission
- (WINDOWS) PublicKeyCredential fingerprinting mitigations, see #1758
- (DESKTOP) Disable Bluetooth API by default
#### Tracking navigation
- Enable network isolation features