Copy Image to Clipboard from Browser in Javascript?

☆樱花仙子☆ 提交于 2019-11-26 14:29:35

问题


Is it possible to copy an image to the clipboard in javascript? I know how to copy text, but can you copy images?

Is it a security limitation?


回答1:


No, you can't copy images to the clipboard. Copying anything to the clipboard is a security limitation of every browser, but you may able to copy text to the clipboard in IE if they have the proper security settings. Here Mozilla lists some of the problems caused by programmatic access to the clipboard.




回答2:


Yes, most of the scripts supports text only.

http://forums.mozillazine.org/viewtopic.php?f=25&t=1195035&start=0

The above site also discussing the same issue.

The following site said related to security issues,

http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard

but this won't work in latest version of Mozilla.



来源:https://stackoverflow.com/questions/2321606/copy-image-to-clipboard-from-browser-in-javascript

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