Skip to content

Instantly share code, notes, and snippets.

@rensjaspers
Created June 24, 2017 10:23
Show Gist options
  • Save rensjaspers/070346dad45667c1419f4a4b261aecc0 to your computer and use it in GitHub Desktop.
Save rensjaspers/070346dad45667c1419f4a4b261aecc0 to your computer and use it in GitHub Desktop.
Remove other search engines from Google Chrome
/*
1. ) Go to chrome://settings/searchEngines
2. ) Press Ctrl+Shift+J (or ⌥+⌘+J (Option+Command+J) if you're using Mac OS X)
3. ) Paste this script and press ENTER.
You may have to repeat step 3 two or three times.
*/
var otherSearchEngineList = document.getElementById('other-search-engine-list');
var d = otherSearchEngineList.getElementsByClassName("row-delete-button");
d = Array.prototype.slice.call(d);
d.forEach(function(n) {
var e = document.createEvent("MouseEvents");
e.initEvent("click", true, false);
n.dispatchEvent(e, true);
e = document.createEvent("MouseEvents");
e.initEvent("mousedown", true, false);
n.dispatchEvent(e, true);
e = document.createEvent("MouseEvents");
e.initEvent("mouseup", true, false);
n.dispatchEvent(e, true);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment