Hit send / press enter for already written text in chrome address bar with JavaScript

105 Views Asked by At

Suppose the user has the following text written in the chrome address bar: "google this"

I need my chrome extension command to hit the send button or enter for this text so that a search query can be initiated. Then I read in the onBeforeRequest listener to add some other parameters to the search and redirect to a new URL.

It appears that it's not possible to read and modify the address bar text directly, which is why I resorted to this indirect way.

My question is: how do I initiate the search so that user can press my command shortcut to search instead of the 'Enter' button?

0

There are 0 best solutions below