Disable Device Attributes API: keep the feature disabled in the (unlikely) event that it is activated in Chromium
This commit is contained in:
@@ -303,6 +303,7 @@ Add-cromite-test-support.patch
|
||||
Android-Pixel-Perfect-Mode.patch
|
||||
Set-caret-blink-interval-to-default.patch
|
||||
Set-the-screen-frame-rate-to-60-Hz.patch
|
||||
Disable-Device-Attributes-API.patch
|
||||
Temp-disable-UseContextSnapshot.patch
|
||||
|
||||
# temporary or wip patches
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Wed, 10 Sep 2025 07:46:17 +0000
|
||||
Subject: Disable Device Attributes API
|
||||
|
||||
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
---
|
||||
chrome/browser/device_api/device_service_impl.cc | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/chrome/browser/device_api/device_service_impl.cc b/chrome/browser/device_api/device_service_impl.cc
|
||||
--- a/chrome/browser/device_api/device_service_impl.cc
|
||||
+++ b/chrome/browser/device_api/device_service_impl.cc
|
||||
@@ -166,6 +166,7 @@ bool IsPermissionsPolicyFeatureEnabled() {
|
||||
|
||||
bool IsTrustedContext(content::RenderFrameHost& host,
|
||||
const url::Origin& origin) {
|
||||
+ if ((true)) return false;
|
||||
// Do not create the service for the incognito mode.
|
||||
if (GetProfile(host)->IsIncognitoProfile()) {
|
||||
return false;
|
||||
@@ -361,6 +362,10 @@ void DeviceServiceImpl::GetAnnotatedLocation(
|
||||
void DeviceServiceImpl::GetDeviceAttribute(
|
||||
void (DeviceAttributeApi::*method)(DeviceAttributeCallback callback),
|
||||
DeviceAttributeCallback callback) {
|
||||
+ if ((true)) {
|
||||
+ device_attribute_api_->ReportNotAllowedError(std::move(callback));
|
||||
+ return;
|
||||
+ }
|
||||
if (!IsAffiliatedUser()) {
|
||||
device_attribute_api_->ReportNotAffiliatedError(std::move(callback));
|
||||
return;
|
||||
--
|
||||
Reference in New Issue
Block a user