Obtain the search query from a Google search results URL
<p>Is it possible to obtain the search query from Google search results page, given the page's URL?  I've noticed that the search query is usually shown in the URL, but the format of the URL can sometimes be slightly confusing.</p>

<p>For example, one search results URL for the search <code>stackoverflow</code> is</p>

<blockquote>
  <p><a href="https://www.google.com/webhp?hl=en&amp;tab=ww#hl=en&amp;tbo=d&amp;sclient=psy-ab&amp;q=stackoverflow&amp;oq=stackoverflow&amp;gs_l=hp.3..35i39l2j0l2.920.3338.0.3436.13.12.0.0.0.0.310.1216.10j1j0j1.12.0.les%3B..0.0...1c.1.3.psy-ab.OH00abu0aqs&amp;pbx=1&amp;bav=on.2,or.r_gc.r_pw.r_cp.r_qf.&amp;bvm=bv.42452523,d.dmQ&amp;fp=8bb62755c027473d&amp;biw=1366&amp;bih=631" rel="nofollow">https://www.google.com/webhp?hl=en&amp;tab=ww#hl=en&amp;tbo=d&amp;sclient=psy-ab&amp;q=stackoverflow&amp;oq=stackoverflow&amp;gs_l=hp.3..35i39l2j0l2.920.3338.0.3436.13.12.0.0.0.0.310.1216.10j1j0j1.12.0.les%3B..0.0...1c.1.3.psy-ab.OH00abu0aqs&amp;pbx=1&amp;bav=on.2,or.r_gc.r_pw.r_cp.r_qf.&amp;bvm=bv.42452523,d.dmQ&amp;fp=8bb62755c027473d&amp;biw=1366&amp;bih=631</a></p>
</blockquote>

<p>Another URL for the same search string is</p>

<blockquote>
  <p><a href="https://www.google.com/search?btnG=1&amp;pws=0&amp;q=stackoverflow" rel="nofollow">https://www.google.com/search?btnG=1&amp;pws=0&amp;q=stackoverflow</a>.</p>
</blockquote>

<p>Would there be any way to obtain the Google search query from all types of Google search result URLs using JavaScript?</p>
