title: Multi-parameter keyword search in Firefox does not work for this URL
body: <p>I am trying to get the multi-parameter search working in Firefox. </p>
  
  <p>This requires the use of Javascript code from <a href="http://kb.mozillazine.org/Multiple_parameter_keyword_searches" rel="nofollow">here</a>.</p>
  
  <p>I have been trying to understand the code and to get it to work for the Maven Central Repository search. <a href="http://search.maven.org/#search%7Cga%7C1%7Cg%3ajtidy%20a%3ajtidy" rel="nofollow">This</a> is a sample search I am trying to perform via a keyword search. After replacing the <em>###INSERT YOUR KEYWORD SEARCH URL HERE###</em> with my search URL :     <code>http://search.maven.org/#search|ga|1|g%3A%s%20a%3A%s</code> I get the following bookmarklet code :</p>
  
  <pre><code>javascript:var%C2%A0s='%s';%20url='http://search.maven.org/#search|ga|1|g%3A%s%20a%3A%s';%20t='';%20qc=0;%20chunks=url.split('%s');%20for(i=0;%20i&lt;s.length;%20i++){if(s.charAt(i)=='"')qc=qc^1;%20t+=((s.charAt(i)=='%20'&amp;&amp;qc)?'^':s.charAt(i));%20}args=t.split(/\s/);%20nurl='';%20for(i=0;%20i&lt;chunks.length;%20i++){nurl+=chunks[i];%20if(args[i]!=undefined)%C2%A0{args[i]=args[i].replace(/\^/g,'%20');%20nurl+=args[i];%20}}location.replace(nurl,'&lt;%20BR&gt;');
  </code></pre>
  
  <p>But unfortunately, that does not seem to work. I have tried to debug the beautified, un-encoded code in Firebug but I cannot wrap my head around what it does :</p>
  
  <pre><code>var s = '%s';
  url = 'http://search.maven.org/#search|ga|1|g:%s a:%s';
  t = '';
  qc = 0;
  chunks = url.split('%s');
  for (i = 0; i &lt; s.length; i++) {
      if (s.charAt(i) == '"') qc = qc ^ 1;
      t += ((s.charAt(i) == ' ' &amp;&amp; qc) ? '^' : s.charAt(i));
  }
  args = t.split(/\s/);
  nurl = '';
  for (i = 0; i &lt; chunks.length; i++) {
      nurl += chunks[i];
      if (args[i] != undefined) {
          args[i] = args[i].replace(/\^/g, ' ');
          nurl += args[i];
      }
  }
  location.replace(nurl, '&lt; BR&gt;');
  </code></pre>
  
  <p>It seems that the apparent complexity of my search URL upsets the above bookmarklet. The <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=124237" rel="nofollow">bug 124237</a> referred to in the mozillaZine KB article also has a bookmarklet generator which generates the exact same code as above.</p>
  
  <p>It would be great if I could get hints on what might be going wrong.</p>
  
  <p>Thanks!</p>