Skip to content

Instantly share code, notes, and snippets.

@neilio
Last active April 28, 2020 19:26
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 neilio/1308745d37383863fffbd13e9c0b197b to your computer and use it in GitHub Desktop.
Save neilio/1308745d37383863fffbd13e9c0b197b to your computer and use it in GitHub Desktop.
Export Chrome search keywords
(function exportSEs() {
/* Auxiliary function to download a file with the exported data */
function downloadData(filename, data) {
const file = new File([data], { type: 'text/json' });
const elem = document.createElement('a');
elem.href = URL.createObjectURL(file);
elem.download = filename;
elem.click();
}
/* Actual search engine export magic */
settings.SearchEnginesBrowserProxyImpl.prototype.getSearchEnginesList()
.then((searchEngines) => {
downloadData('search_engines.json', JSON.stringify(searchEngines.others));
});
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment