Skip to content

Instantly share code, notes, and snippets.

@halilim
Last active July 4, 2017 11:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save halilim/5888f509e079610016233176c85f9b46 to your computer and use it in GitHub Desktop.
Remove automatically created search engines from Chrome.

Remember:

  1. HTML element ids/classes/structure can change with time
  2. This might remove more than needed. Check the confirmation

To run:

  1. Open Chrome settings (Cmd + ,)
  2. Open the list of search engines
  3. Open the developer console (Cmd + Shift + I)
  4. Run the code
var others = document.querySelectorAll("#other-search-engine-list .deletable-item:not([lead=lead])");
var toBeRemoved = [...others].filter(function(listItem) {
var keyword = listItem.querySelector(".keyword-column .static-text").innerText;
return keyword.includes(".") &&
listItem.querySelector(".url-column .static-text").innerText.toLowerCase().includes(
keyword.toLowerCase()
);
});
if (confirm(`Search engines: \
${document.querySelectorAll("#default-search-engine-list .deletable-item").length} default, \
${others.length} other, \
${toBeRemoved.length} to be removed.\nRemove?`)) {
toBeRemoved.forEach(function(listItem) {
listItem.querySelector(".row-delete-button").click();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment