Search multiple search engines with a single keyword at the same time in Chrome?
I want to search multiple websites at once by using a keyword trigger in Google Chrome. I am trying to achieve this with Javascript as described in this topic over at mozillazine.
This is the code that supposedly works in Firefox:
javascript:void(window.open('http://www.google.com/search?q=%s'));void(window.open('http://www.altavista.com/web/results?q=%s'))
I have tried to insert this code into the "URL with %s in place of query" (right click address bar -> Edit search engines) but nothing happens when I invoke it. Is it possible to get this to work this way or another in Chrome? I would prefer to achieve this without extensions. I would appreciate a comment if it is impossible. Thank you!
This isn't exactly what you were looking for, but it is quite helpful. Search Center which is an addon to Chrome, lets you search many sites an you can add your own too.
I have tried to insert this code [...] but nothing happens when I invoke it.
When you use a search engine from the omnibox, it just transforms the query string into an URL. That works well with actual URLs, but it can fail with javascript:
.
You will be able to use this custom search if you're in a tab displaying a normal website, but not if you're looking at the New Tab or Settings page, for example. The reason is that Chrome disables javascript:
URLs in any form (direct invocation from omnibox, custom search, bookmark, etc.) for the internal chrome://
pages (source).
This is done for security reasons, since these pages often contain sensitive information (e.g., New Tab contains links to the most visited websites), and JavaScript could access and divulge that information.
Is it possible to get this to work this way or another in Chrome? I would prefer to achieve this without extensions.
I don't think that there's a straightforward way of achieving this, as any attempt to automatically open several tabs from a common HTML page will result in several new windows (unless this is desired).
The best way to solve this would probably be an extension.
Further options:
-
Keep using your existing approach.
Just make sure you don't open a new tab before you search. Since your custom search doesn't modify the existing tab, you might get used to that.
-
"Extend" your search with a bookmark.
Leave Google (for example) as your default search and create the following bookmark:
Name: Extend Google search URL: javascript:var q=document.location.search.match(/[?&][pq]=(.*?)(&|$)/)[1];window.open('http://www.altavista.com/web/results?q='+q);window.open('http://www.bing.com/search?q='+q);void(0)
Clicking the bookmark after performing a Google search will search in all other engines.