Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove chrome "other search engines"
// 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) {
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);
}
});
});
@sturmen

This comment has been minimized.

Copy link

commented Nov 29, 2017

Thanks for this! It's so annoying that Google makes this so hard.

@penguin020

This comment has been minimized.

Copy link

commented Dec 22, 2017

Just in case you are trying to use this with the (keep) mechanism, I think that the engine.modelIndex can get muddled if you do not refresh between runs of this script, possibly deleting engines you wish to keep.

UPDATE: if you reverse sort by modelIndex, this problem is obviated.

Add

val.others.sort(function (a, b) { return b.modelIndex - a.modelIndex; });

just after the .then.

@EpicLPer

This comment has been minimized.

Copy link

commented Dec 31, 2017

Thanks for this! Saved me from an hour of work haha.

@SrLeojaco

This comment has been minimized.

Copy link

commented Jan 1, 2018

thanks <3

@nerdcloud

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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
You can’t perform that action at this time.