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.
Screencapture from the browser using Javascript?
Asked Answered
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. –
Vallee
I want to dump the content of a Silverlight object - by that I mean the actual rendered output. –
Woodenhead
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. –
Sylvan
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! –
Woodenhead
This question has been asked a lot on StackOverflow. This is one of the oldest, but best threads about it: <strong> #60955 </strong> –
Azucenaazure
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.
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. –
Azucenaazure
how is that relevant to the question of taking screenshots of a Silverlight plug-in? –
Adelinaadelind
Well 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. –
Azucenaazure
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.
© 2022 - 2024 — McMap. All rights reserved.