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

末鹿安然 提交于 2019-12-01 12:49:57

问题


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


回答1:


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!




回答2:


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




回答3:


try this :you can create your own COM object that will registered on client

http://febru.soluvas.com/2015/02/javascript-move-mouse.html



来源:https://stackoverflow.com/questions/2409867/move-mouse-cursor-using-javascript-in-chrome-or-firefox-using-any-method-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!