Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tzutalin
Last active March 26, 2020 20:43
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 tzutalin/57afa19a00a4d5b7bb49a760c124fc15 to your computer and use it in GitHub Desktop.
Save tzutalin/57afa19a00a4d5b7bb49a760c124fc15 to your computer and use it in GitHub Desktop.
js script to remove all other search engines in chrome
removedName = ['groupon',
'avg',
'red',
'Jenkins',
'petewarden',
'booking',
'Hudson',
'blog',
'ebay',
'pchome'
]
settings.SearchEnginesBrowserProxyImpl.prototype.getSearchEnginesList()
.then(function(val) {
val.others.sort(function(a, b) { return b.modelIndex - a.modelIndex; });
val.others.forEach(function(engine) {
if (engine) {
const name = engine.displayName.toLowerCase();
// console.log(name);
for (let i = 0 ; i < removedName.length; i++) {
if (name.includes(removedName[i].toLowerCase())) {
console.log("Removed "+ name);
settings.SearchEnginesBrowserProxyImpl.prototype.removeSearchEngine(engine.modelIndex);
break;
}
}
}
});
});
settings.SearchEnginesBrowserProxyImpl.prototype.getSearchEnginesList()
.then(function(val) {
val.others.sort(function(a, b) { return b.modelIndex - a.modelIndex; });
val.others.forEach(function(engine) {
if (engine) {
console.log(engine.displayName);
settings.SearchEnginesBrowserProxyImpl.prototype.removeSearchEngine(engine.modelIndex);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment