Skip to content

Instantly share code, notes, and snippets.

@dmwyatt
Last active May 2, 2024 02:48
Show Gist options
  • Save dmwyatt/0917eb1232b324903843f57f27656ccd to your computer and use it in GitHub Desktop.
Save dmwyatt/0917eb1232b324903843f57f27656ccd to your computer and use it in GitHub Desktop.
[Remove chrome "other search engines"] #chrome
// 1. open chrome://settings/searchEngines
// 2. press Ctrl-Shift-J to open console
// 3. paste the following code
// note: you may have to run it multiple times to get rid of all of them
// If you have search engines you want to use add the text "(KEEP)" to their name
// and by name i mean the "Search engine" field when you add/edit one of the search engines
settings.SearchEnginesBrowserProxyImpl.prototype.getSearchEnginesList()
.then(function (val) {
val.others.sort(function (a, b) { return b.modelIndex - a.modelIndex; });
let filterer = arr => {
return arr.others.filter(engine => {
return (Object.prototype.toString.call(engine.displayName) === "[object String]")
&& !engine.displayName.includes('(KEEP)');
});
};
filterer(val).forEach(function (engine) {
if ((Object.prototype.toString.call(engine.displayName) === "[object String]")
&& !engine.displayName.includes('(KEEP)')) {
settings.SearchEnginesBrowserProxyImpl
.prototype
.removeSearchEngine(engine.modelIndex);
console.log('removed:', engine.displayName);
}
});
});
@3000nz
Copy link

3000nz commented Jan 5, 2018

worked perfectly! I had to do it multiple times. Is there a way to block chrome form adding search engines automatically?

@johnxie
Copy link

johnxie commented Jan 29, 2018

Thanks for this!

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