Skip to content

Instantly share code, notes, and snippets.

@Goblin80
Created May 1, 2020 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Goblin80/684fabc153f3365825442956562a3fa4 to your computer and use it in GitHub Desktop.
Save Goblin80/684fabc153f3365825442956562a3fa4 to your computer and use it in GitHub Desktop.
Remove Chrome's Custom Search Engines
// Go to chrome://settings/searchEngines
// Open the Developer Tools
// Run the following in the Javascript console tab
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); // adjust the sleep duration as you see fit.
}
@Goblin80
Copy link
Author

Goblin80 commented May 1, 2020

If you want a permanent solution and don't mind installing an extra chrome extension:

Don't add custom search engines by Greg Sadetsky,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment