Reputation: 1102
Is it possible to capture a screenshot of the client's windows desktop using javascript? What about in linux and mac OS?
Clarification
This question has not been asked or answered, because I'm looking to capture the entire desktop, not just the browser. I would also like to capture 'native' screenshot rather than one that is recreated from some underlying representation (which would be impossible on any OS).
Upvotes: 6
Views: 3706
Reputation: 1309
There is an API called getDisplayMedia
that lets you capture screen contents as a live MediaStream. It doesnt have a lot of support in browsers though.
https://developer.mozilla.org/en-US/docs/Web/API/Screen_Capture_API/Using_Screen_Capture
If you just want a screenshot, you should be able to find a way to extract just a frame from the streaming video. Check this answer
Upvotes: 1
Reputation: 35973
Exist a plugin that you can configure the image that you want to take or part of element of your DOM like the body
or a particular div
.
Plugin is: HTML2CANVAS
Upvotes: 0