使用任意方法(插件、GreaseMonkey?)在 Chrome 或 Firefox 中使用 JavaScript 移动鼠标光标
我需要在浏览器中移动鼠标光标位置,我可以使用任何方法,只要它在 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.
Any easy way to do this? Thanks! Phil
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为这是不可能的。尽管 Greasemonkey 提供了一些附加功能(例如跨服务器 XMLHttpRequests),但我认为这还没有实现。
也许您正在寻找可用于 Firefox 扩展的功能。但我不确定。
也许您可以模仿 LMGTFY 中的这种行为。我想你可以用 CSS 隐藏鼠标。
编辑:我使用 bit.ly 和 LMGTFY 来证明我的观点。问题是关于隐藏鼠标。 各位,请在投票和编辑之前阅读!
I don't think this is possible. Altough Greasemonkey gives some additional features (like Cross-Server XMLHttpRequests), I don't think this has been implemented.
Perhaps what you are looking for is a feature available for Firefox extensions. But I'm not sure.
Maybe you can emulate this behaviour as in LMGTFY. You can hide the mouse with CSS, I think.
Edit: I'm using both bit.ly and LMGTFY to stand my point. The question is about hiding a mouse. Please read before voting and editing, people!
从特权 Firefox (JS) 代码中,您可以调用
nsIDOMWindowUtils.sendNativeMouseEvent(x, y, 0, 0, null)
重新定位鼠标光标,其中(x,y)
是绝对屏幕坐标。请参阅https://stackoverflow.com/a/39324799/1288130From 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试试这个:您可以创建自己的 COM 对象,该对象将在客户端
http: 上注册//febru.soluvas.com/2015/02/javascript-move-mouse.html
try this :you can create your own COM object that will registered on client
http://febru.soluvas.com/2015/02/javascript-move-mouse.html