Last active
May 7, 2017 03:19
-
-
Save syusui-s/27532dd0447275d43207e8c067ce6a32 to your computer and use it in GitHub Desktop.
A script to copy Chrome's search engine settings into Vimium's settings format. 1. Open chrome://settings/searchEngines. 2. Copy this script and paste to JavaScript console. 3. Execute.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
'use strict'; | |
const engines = []; | |
engines.push(...document.querySelectorAll('list#default-search-engine-list div[role="listitem"]')); | |
engines.push(...document.querySelectorAll('list#other-search-engine-list div[role="listitem"]')); | |
engines.pop(); | |
const data = engines.map(e => { | |
const [name, keyword, url] = Array.from(e.querySelectorAll('.static-text')).map(e => e.textContent); | |
return `# ${name}\n${keyword}: ${url}\n`; | |
}).join('\n'); | |
console.log(data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment