Get URL of page that isn't appearing in the search bar? Google instant

117 views Asked by At

I'm developing an extension and I've run into a problem... I'm wondering how would I grab the URL's of a Google instant search page? Since the browsers http bar doesn't update! I would really appreciate any help with this!

Google instant appears to be using ajax to generate it's results. I need a way of grabbing the new URL when the page updates.

1

There are 1 answers

4
Arnaud Le Blanc On

The hash part of the URL is updated a few seconds after the last typed key.

If you can't wait, you could be able to build the URL by serializing the search form:

// (jquery / pseudo code)
var base = $('form[name="gs"]').attr('action');
var params = $('form[name="gs"]').serialize();
var url = base + '?' + params;

The resulting URL will be similar to what it would have looked if the user submitted the form.