I guess this is an odd one, and the answer is most likely it is not possible since it would represent a security breach; but I am looking for a way - if any - to get a screendump of content inside the browser. I don't need the entire window, but actually just need to dump the rendered state of an tag. It need to be cross platform and cross browser compatible.
Asked
Active
Viewed 5,947 times
3
-
Could you give a little bit more details on what exactly you are trying to do. What is the tag for example. what kind of state information you need and what are you planning on doing with it. Based on your short explanation I don't think a screencapture is needed. – Gene Oct 08 '08 at 07:17
-
I want to dump the content of a Silverlight object - by that I mean the actual rendered output. – EinarI Oct 08 '08 at 07:18
-
Is that not possible to do with Silverlight APIs? It can be done in Flash, for example. I don't think it's going to be possible from JS, so doing it inside SL is probably the only option. – fenomas Oct 08 '08 at 07:29
-
Really. It can be done with flash.. Hmm.. That makes me think; instantiate Flash and let it do all the dirty work for me. Haven't found a way in SL to do this. Thanks for the lead! – EinarI Oct 08 '08 at 07:48
-
This question has been asked a lot on StackOverflow. This is one of the oldest, but best threads about it: http://stackoverflow.com/questions/60455/take-a-screenshot-of-a-webpage-with-javascript – Simon East Oct 20 '12 at 00:14
2 Answers
1
It cannot be done (yet) in pure JavaScript.
As a side-note, if your goal is to make rendering tests, you could try instantiating the target browsers within a hosted environment (i.e. host Internet Explorer in a WinForms application and get a screenshot of the rendered content) - this will show the Silverlight plug-in and allow taking screenshots.

Alex Gyoshev
- 11,929
- 4
- 44
- 74
-
No longer true as of 2011/2012. Although browsers cannot initiate screenshots (without plugins/extensions) some browsers DO now support pasting of binary image data. – Simon East Oct 19 '12 at 23:59
-
how is that relevant to the question of taking screenshots of a Silverlight plug-in? – Alex Gyoshev Oct 23 '12 at 07:59
-
1Well it's now possible to be viewing a page, hit the printscreen button, then hit paste into the browser window, letting the site's javascript handle the image (which was *not* possible a couple of years ago). But you still can't perform the entire 'printscreen' process automatically with javascript. I guess that's what I meant. – Simon East Oct 23 '12 at 11:30
0
If you don't need an actual screen shot, you can grab the innerHTML of your content and send it back to the server via Ajax, stash it somewhere and view it remotely.

Diodeus - James MacFarlane
- 112,730
- 33
- 157
- 176