Skip to content

Instantly share code, notes, and snippets.

@370417
Created August 2, 2016 06:36
Show Gist options
  • Save 370417/aacafd8fcd61c13143595b720507b89f to your computer and use it in GitHub Desktop.
Save 370417/aacafd8fcd61c13143595b720507b89f to your computer and use it in GitHub Desktop.
Chrome seach bar
<!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