diff --git a/browser/resources/settings/brave_overrides/privacy_page.js b/browser/resources/settings/brave_overrides/privacy_page.js index ba268b9987f3..6b814cfecacf 100644 --- a/browser/resources/settings/brave_overrides/privacy_page.js +++ b/browser/resources/settings/brave_overrides/privacy_page.js @@ -5,6 +5,7 @@ import {RegisterPolymerTemplateModifications} from 'chrome://brave-resources/polymer_overriding.js' import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js' +import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; RegisterPolymerTemplateModifications({ 'settings-privacy-page': (templateContent) => { @@ -12,6 +13,14 @@ RegisterPolymerTemplateModifications({ if (!pages) { console.error(`[Brave Settings Overrides] Couldn't find privacy_page #pages`) } else { + if (!loadTimeData.getBoolean('isIdleDetectionFeatureEnabled')) { + const idleDetection = templateContent.querySelector('[route-path="/content/idleDetection"]') + if (!idleDetection) { + console.error(`[Brave Settings Overrides] Couldn't find idle detection template`) + } else { + idleDetection.content.firstElementChild.hidden = true + } + } pages.insertAdjacentHTML('beforeend', `