This works fine with Firefox, and conforms to the spec.
However, Chromium gets confused and clicks on the wrong position. Work
around that for now by keeping our old `ph_mouse()` event synthesizer
for Chromium.
This makes waiting for text robust.
script.addPreloadScript() doesn't export the declared functions, so we
need to attach them to `window`. We also don't need all of them.