Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 9ef62194 authored by Carmelo Messina's avatar Carmelo Messina
Browse files

Disable Device Attributes API: keep the feature disabled in the (unlikely)...

Disable Device Attributes API: keep the feature disabled in the (unlikely) event that it is activated in Chromium
parent a9734772
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+32 −0
Original line number Diff line number Diff line
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;
--