From b5de34864dad9d8dfd56562e2a61360e66b828b5 Mon Sep 17 00:00:00 2001 From: mkarolin Date: Wed, 16 Sep 2020 15:26:27 -0400 Subject: [PATCH] Settings UI: hides passwords item in Safety Check section. Fixes brave/brave-browser#11741 --- .../resources/settings/brave_overrides/index.js | 1 + .../safety_check_passwords_child.js | 17 +++++++++++++++++ .../resources/settings/settings_resources.grd | 5 +++++ 3 files changed, 23 insertions(+) create mode 100644 browser/resources/settings/brave_overrides/safety_check_passwords_child.js diff --git a/browser/resources/settings/brave_overrides/index.js b/browser/resources/settings/brave_overrides/index.js index 4895cd0823a5..5ed0439996e1 100644 --- a/browser/resources/settings/brave_overrides/index.js +++ b/browser/resources/settings/brave_overrides/index.js @@ -21,6 +21,7 @@ import './page_visibility.js' import './payments_section.js' import './people_page.js' import './printing_page.js' +import './safety_check_passwords_child.js' import './security_page.js' import './settings_menu.js' import './settings_section.js' diff --git a/browser/resources/settings/brave_overrides/safety_check_passwords_child.js b/browser/resources/settings/brave_overrides/safety_check_passwords_child.js new file mode 100644 index 000000000000..48eb7d5ffa20 --- /dev/null +++ b/browser/resources/settings/brave_overrides/safety_check_passwords_child.js @@ -0,0 +1,17 @@ +// Copyright (c) 2020 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// you can obtain one at http://mozilla.org/MPL/2.0/. + +import {RegisterPolymerTemplateModifications} from 'chrome://brave-resources/polymer_overriding.js' + +RegisterPolymerTemplateModifications({ + 'settings-safety-check-passwords-child': (templateContent) => { + const safetyCheckChild = templateContent.getElementById('safetyCheckChild') + if (!safetyCheckChild) { + console.error('[Brave Settings Overrides] Could not find safetyCheckChild id on safety check passwords child page.') + } else { + safetyCheckChild.setAttribute('hidden', 'true') + } + } +}) diff --git a/browser/resources/settings/settings_resources.grd b/browser/resources/settings/settings_resources.grd index d005e4415412..a9d159d313d4 100644 --- a/browser/resources/settings/settings_resources.grd +++ b/browser/resources/settings/settings_resources.grd @@ -99,6 +99,11 @@ compress="false" preprocess="true" type="BINDATA" /> +