Programmatically Calling Browser Right-Click Menu Options?

谁说胖子不能爱 提交于 2019-12-20 07:25:06

问题


I would like to be able to programmatically invoke the right-click menu options, initiated from user events like rollover and whatnot of course. Is this possible?

Specifically, I would like to be able to call the Safari "Use Image as Desktop Picture" or the "Add Image to iPhoto Library", or the Firefox "Set as Desktop Background" using pure Javascript, so you don't have to right click. Is that possible?


回答1:


You can't and this is because of security limitations.

If you could do that, malicious websites can access your browser and tamper with your system.




回答2:


As far a I know, there is absolutely no way of doing this in a generic form using pure Javascript. You would have to build extensions (or maybe a Greasemonkey script for Firefox, I don't know) for each browser.




回答3:


I seriously hope you can't do that... No website should be able to touch my desktop picture or iPhoto library.



来源:https://stackoverflow.com/questions/1896362/programmatically-calling-browser-right-click-menu-options

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