Easy Proof Omitted

A sink for random thoughts & experiments

0%

Remove Chrome's Custom Search Engines

At the time of writing, this "feature" cannot be disabled without a dedicated chrome extension1. And of course removing each item one by one is unreasonable.

Hence the following JS snippet iterate over each item in the list and clicks the delete button.

Usage

  1. Go to the search engine settings chrome://settings/searchEngines.
  2. Open the Developer Tools by clicking F12 or CTRL+SHIFT+I.
  3. Copy the script below and paste it in the Javascript console tab.
  4. Fire Away.

Snippet

A slight delay has been added between clicks since after each action the browser takes a moment to render the view. feel free to adjust the sleep at line 16 as you see fit.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const otherEngines = document.querySelector("body > settings-ui")
.shadowRoot.querySelector("#main")
.shadowRoot.querySelector("settings-basic-page")
.shadowRoot.querySelector("#basicPage > settings-section.expanded > settings-search-page")
.shadowRoot.querySelector("#pages > settings-subpage > settings-search-engines-page")
.shadowRoot.querySelector("#otherEngines").shadowRoot

let n = otherEngines.querySelector('iron-list').childElementCount - 1;
let rmbtn = otherEngines.querySelector('#frb0')
.shadowRoot.querySelector('#delete')

const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));

while(n--) {
rmbtn.click();
await sleep(2000);
}

  1. Don't add custom search engines by Greg Sadetsky,↩︎