Preventing sites to add themselves to the Google Chrome search engine list
Posted by jpluimers on 2019/01/11
For a long time, sites have been able to add themselves to the search engine list in Google Chrome.
The last one is my own, but hundreds of them are not.
I never noticed this until I needed to add some custom search engine strings to the list and found the UI is obnoxiously slow when there are hundreds of entries in that list.
It’s like the cookies editor: the editing speed decreases exponentially with the number of entries in that list.
The feature is called Tab to Search
, apparently is intentional, based on the OpenSearch
standard and well documented:
- [WayBack] Tab to Search – The Chromium Projects
- [WayBack] Specifications/OpenSearch/1.1/Draft 5 – OpenSearch
Many people dislike it though:
- [Archive.is] Why chrome adds search engines automatically? – Google Product Forums
- [WayBack] Google Chrome automatically adding websites to my list of search engines? – Super User
There are various ways around it documented in the last link.
This is the one I liked best: [WayBack] Don’t add custom search engines – Chrome Web Store.
Via: [WayBack] Google Chrome: Remove all ‘Other Search Engines’ – Super User who also pointed me to the script below the signature ([WayBack] Remove chrome “other search engines” · GitHub), which likely needs this change:
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
.
–jeroen
// 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); | |
} | |
}); | |
}); |
penguin020 commented on Dec 22, 2017 •