Created
August 2, 2016 06:36
-
-
Save 370417/aacafd8fcd61c13143595b720507b89f to your computer and use it in GitHub Desktop.
Chrome seach bar
This file contains hidden or 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
<!DOCTYPE html> | |
<html><head><title></title><script> | |
const [query, bang] = window.location.search.substring(3).split('!'); | |
const [root, search] = { | |
b: ['bing.com/', 'search?q='], | |
bi: ['bing.com/images/', 'search?q='], | |
g: ['google.com/', '#q='], | |
i: ['google.com/search?tbm=isch', '&q='], | |
r: ['reddit.com/', 'r/'], | |
so: ['stackoverflow.com/', 'search?q='], | |
w: ['en.wikipedia.org/wiki/', 'Special:Search?go=Go&search='], | |
wa: ['wolframalpha.com/', 'input/?i='], | |
yt: ['youtube.com/', 'results?search_query='], | |
}[bang || 'g']; | |
window.location = 'https://' + root + (query && search + query); | |
</script></head></html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment