I am trying to use Chrome extension to simulate these actions: open a new tab, update the url, click the input box and paste a string to the input box.
However, when the url was updated, the focus still stayed in the address bar instead of the page content, even after I found the input element and did element.click()
and element.focus()
. So I always pasted the string to the address bar instead of the input box.
How could I set the focus away from the address bar??