Answer the question
In order to leave comments, you need to log in
Change your search query on Google
I am writing a small extension for Google Chrome, which will add a few goodies to Google's search results. However, there was such a gag: how to correctly track the change in the search query? And how to get this request in general?
Now I do this on a timer, by checking the document.title and window.location.hash values, and the query string is obtained through the following expression:
document.title.match(/^(.*)-[^-]+$/)[1].trim()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question