From 6ceda90a2ec65dc8bfc81f30cb71247bf64f8195 Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Fri, 24 Jan 2025 15:55:52 +0100 Subject: [PATCH] Disable Web Bluetooth by default in desktop platforms: on desktop platforms, disable Bluetooth by default and activate the user-manageable content setting ui. (#1758) --- ...ooth-by-default-in-desktop-platforms.patch | 39 +++++++++++++++++++ docs/FEATURES.md | 1 + 2 files changed, 40 insertions(+) create mode 100644 build/patches/Disable-Web-Bluetooth-by-default-in-desktop-platforms.patch diff --git a/build/patches/Disable-Web-Bluetooth-by-default-in-desktop-platforms.patch b/build/patches/Disable-Web-Bluetooth-by-default-in-desktop-platforms.patch new file mode 100644 index 00000000..835bad58 --- /dev/null +++ b/build/patches/Disable-Web-Bluetooth-by-default-in-desktop-platforms.patch @@ -0,0 +1,39 @@ +From: uazo +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 +-- diff --git a/docs/FEATURES.md b/docs/FEATURES.md index 17bc940e..56e1e39f 100644 --- a/docs/FEATURES.md +++ b/docs/FEATURES.md @@ -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