diff --git a/browser/resources/settings/brave_overrides/index.ts b/browser/resources/settings/brave_overrides/index.ts index 716f20df1f85..41d92ec194b3 100644 --- a/browser/resources/settings/brave_overrides/index.ts +++ b/browser/resources/settings/brave_overrides/index.ts @@ -35,6 +35,7 @@ import './safety_check.js' import './safety_check_passwords_child.js' import './safety_hub_page.js' import './search_page.js' +import './search_engines_page.js' import './security_page.js' import './settings_menu.js' import './settings_section.js' diff --git a/browser/resources/settings/brave_overrides/search_engines_page.ts b/browser/resources/settings/brave_overrides/search_engines_page.ts new file mode 100644 index 000000000000..be39876fbfae --- /dev/null +++ b/browser/resources/settings/brave_overrides/search_engines_page.ts @@ -0,0 +1,39 @@ +// Copyright (c) 2022 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 https://mozilla.org/MPL/2.0/. + +import {RegisterPolymerTemplateModifications} from 'chrome://resources/brave/polymer_overriding.js' +import {RegisterStyleOverride} from 'chrome://resources/brave/polymer_overriding.js' +import {html} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js' + +RegisterPolymerTemplateModifications({ + 'settings-search-engines-page': (templateContent) => { + const addSearchEngineButton = templateContent.getElementById("addSearchEngine"); + if(!addSearchEngineButton) { + console.error("[Brave Settings Overrides] Couldn't find addSearchEngine button"); + return; + } + + const activeEnginesList = templateContent.getElementById("activeEngines"); + if(!activeEnginesList) { + console.error("[Brave Settings Overrides] Couldn't find activeEnginesList template"); + return; + } + + // moving addSearchEngine button below Active Search Engines list + activeEnginesList.after(addSearchEngineButton); + } +}) + +RegisterStyleOverride( + 'settings-search-engines-page', + html` + + ` + ) diff --git a/browser/resources/settings/sources.gni b/browser/resources/settings/sources.gni index 338fb4306176..a225681b5b67 100644 --- a/browser/resources/settings/sources.gni +++ b/browser/resources/settings/sources.gni @@ -92,6 +92,7 @@ brave_settings_non_web_component_files = [ "brave_overrides/safety_check_passwords_child.ts", "brave_overrides/safety_hub_page.ts", "brave_overrides/search_page.ts", + "brave_overrides/search_engines_page.ts", "brave_overrides/security_page.ts", "brave_overrides/settings_menu.ts", "brave_overrides/settings_section.ts",