Move mouse cursor using javascript in Chrome or Firefox using any method (Plugin, GreaseMonkey?)

前端 未结 3 1753
情深已故
情深已故 2021-01-17 00:10

I have need to move the mouse cursor position in the browser, I can use any method as long as its in Google Chrome or Firefox, one or the other. In the best case, I would li

3条回答
  •  长情又很酷
    2021-01-17 00:32

    From privileged Firefox (JS) code you can call nsIDOMWindowUtils.sendNativeMouseEvent(x, y, 0, 0, null) to reposition the mouse cursor, where (x,y) is an absolute screen coordinate. See https://stackoverflow.com/a/39324799/1288130

提交回复
热议问题