html - Copy javascript made images to clipboard - Stack Overflow

Is there today with HTML5 a way to copy to clipboard, without browser plugins (and so without Flash nor

Is there today with HTML5 a way to copy to clipboard, without browser plugins (and so without Flash nor java) nor short-term hacks, an image built in a canvas ?

The copy to clipboard would be initiated by javascript but having user confirmation or a dialog isn't a problem.

Solutions which don't work in Windows and Linux, or which don't work at least in Chrome and Firefox are without interest to me.

Ideally I would prefer a solution that doesn't impose to display the image (which is built in memory with document.createElement('canvas')) but that's not an absolute requirement.

Is there today with HTML5 a way to copy to clipboard, without browser plugins (and so without Flash nor java) nor short-term hacks, an image built in a canvas ?

The copy to clipboard would be initiated by javascript but having user confirmation or a dialog isn't a problem.

Solutions which don't work in Windows and Linux, or which don't work at least in Chrome and Firefox are without interest to me.

Ideally I would prefer a solution that doesn't impose to display the image (which is built in memory with document.createElement('canvas')) but that's not an absolute requirement.

Share Improve this question edited May 15, 2012 at 8:42 Denys Séguret asked May 15, 2012 at 7:46 Denys SéguretDenys Séguret 383k90 gold badges811 silver badges776 bronze badges 3
  • 3 Try here: brooknovak.wordpress./2009/07/28/… – Adriano Repetti Commented May 15, 2012 at 7:50
  • Thanks but this is might not be up to date. In fact I know this wasn't possible a few months ago but I'm wondering if there are new solutions (especially with the new clipboard API ( dev.w3/2006/webapi/clipops ) whose possibilities are somewhat obscure to me). – Denys Séguret Commented May 15, 2012 at 7:55
  • That's API is too new (and unstable) to be used... – Adriano Repetti Commented May 15, 2012 at 8:11
Add a ment  | 

1 Answer 1

Reset to default 6

As far as I'm aware, the Clipboard API is the only specification in this area. I've never used it and don't know how widely it's supported, but I suspect not widely. According to this quick and dirty test, the current versions of Chrome and Firefox fire the copy event. I believe the user has to initiate the copy (e.g., you say "press Ctrl+C to copy").

IE makes window.clipboardData available, but as far as I know you're limited to text and URLs.

So sadly, I think this is one of those answers that's basically: No, not yet.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744868567a4598121.html

相关推荐

  • html - Copy javascript made images to clipboard - Stack Overflow

    Is there today with HTML5 a way to copy to clipboard, without browser plugins (and so without Flash nor

    1天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信