Open mammuth opened 10 years ago
https://stackoverflow.com/questions/13806307/how-to-insert-content-script-in-google-chrome-extension-when-page-was-changed-vi Might be helpful. Also there is more than one "q=" clause in the URL, so maybe check that with lastIndexOf instead of indexOf.
The injection only happens when you browse to google.com/search?* by using Chromes Omnibox meaning that the script never gets injected by using google.de and start typing into the input field.
Maybe with a listener on the input field?