使用JavaScript或Chrome中的JavaScript,使用任何方法(插件,GreaseMonkey?)移动鼠标光标? [英] Move mouse cursor using javascript in Chrome or Firefox using any method (Plugin, GreaseMonkey?)

查看:96
本文介绍了使用JavaScript或Chrome中的JavaScript,使用任何方法(插件,GreaseMonkey?)移动鼠标光标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在浏览器中移动鼠标光标位置,我可以使用任何方法,只要它在Google Chrome或Firefox中,一个或另一个。
在最好的情况下,我想用javascript控制鼠标的位置。

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 like to control the mouse position with javascript.

任何简单的方法来做到这一点?谢谢! Phil

Any easy way to do this? Thanks! Phil

推荐答案

从特权的Firefox(JS)代码可以调用 nsIDOMWindowUtils.sendNativeMouseEvent(x,y,0,0,null) 重新定位鼠标光标,其中(x,y)是一个绝对的屏幕坐标。请参阅 https://stackoverflow.com/a/39324799/1288130

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

这篇关于使用JavaScript或Chrome中的JavaScript,使用任何方法(插件,GreaseMonkey?)移动鼠标光标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆