Zend certified PHP/Magento developer

How to prevent Vivaldi from randomly focusing the URL field instead of the autofocus text input after AutoHotKey-opening it?

I have this AutoHotKey hotkey:

F2::
Run, "http://127.0.0.1/test/"
KeyWait, F2
return

Thus, when I press the F2 button on my keyboard, it opens the URL http://127.0.0.1/test/ in my Web browser, meaning Vivaldi.

If Vivaldi is already open, it opens it in a new tab and focuses it.
If Vivaldi is not already open, it opens Vivaldi and the URL as the one and only tab.

The index.html page, which is valid HTML, just has a simple text field in the body as so:

<div><input spellcheck="true" type="text" name="phrase" id="phrase" size="48" tabindex="1" autofocus></div>

Most of the time, this works. However, “sometimes”, and I cannot for the life of me figure out why it happens (in spite of trying it over and over and over), the input is not autofocused. Instead, Vivaldi focuses the URL field instead, and thus I start typing in the URL field instead of the text input on the page.

It’s difficult to explain just how annoying this is, since I use this mechanism about ten thousand times per day, every day. I’ve tried so many times, but whenever I try to make it happen, I just cannot reproduce it. It simply happens when I least expect it, for seemingly no reason.

It does not depend on whether or not Vivaldi is already running. It also doesn’t seem to matter how quickly I start typing after pressing the F2 button, although I can’t say for sure.

I previously used Pale Moon in the same manner and this did not happen there, so it must be somehow related to Vivaldi. (No, switching back to Pale Moon is not an option.)

Could you fellow superusers please tell me some solution to this to save my sanity?