Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I do multi-parameter queries using Google Chrome custom search engines?

I am migrating from Firefox to Chrome and I haven't been able to copy or emulate my multiple criteria queries. In Firefox it works as a breeze using a javascript script that I have found here but after a lot of testing I think is not possible to implement in Chrome. Take a look at my modified version for converting currency:

javascript:var s='%s'; url='http://www.google.com/finance/converter?a=%s&from=%s&to=%s'; t=''; qc=0; chunks=url.split('%s'); for(i=0; i<s.length; i++){if(s.charAt(i)=='"')qc=qc^1; t+=((s.charAt(i)==' '&&qc)?'^':s.charAt(i)); }args=t.split(/\s/); nurl=''; for(i=0; i<chunks.length; i++){nurl+=chunks[i]; if(args[i]!=undefined) {args[i]=args[i].replace(/\^/g,' '); nurl+=args[i]; }}location.replace(nurl,'< BR>');
like image 818
skriptkiddo Avatar asked Apr 22 '12 06:04

skriptkiddo


2 Answers

. . Sadly this functionality was intentionally disabled, as per this bug report on Chromium (see comment #3).

. . If you want to replicate that functionality, you need to use the Omnibox API. Check http://developer.chrome.com/extensions/samples.html#be68e4d262d74d2457999fc402f5bf5e for an example. It is very easy to adapt the sample code for your needs.

like image 74
diego nunes Avatar answered Oct 24 '22 16:10

diego nunes


Chrome has supported this since at least the date of your question. Here is how I do it:

javascript: (function(){
var s='%s';
url='https://www.google.com/search?hl=en&q=%s&tbo=1&tbs=qdr:%s';
query='';
urlchunks=url.split('%s');
schunks=s.split(';');
for(i=0; i<schunks.length; i++)query+=urlchunks[i]+schunks[i];
location.replace(query);
})();
  1. You can use any URL that has more than one paramenter, which takes more than one argument.
  2. To use from omnibox: search word(s);search word(s)
like image 28
Smack MacDougal Avatar answered Oct 24 '22 16:10

Smack MacDougal