Screencapture from the browser using Javascript?

前端 未结 2 2088
生来不讨喜
生来不讨喜 2021-01-20 05:56

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 scree

相关标签:
2条回答
  • 2021-01-20 05:57

    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.

    0 讨论(0)
  • 2021-01-20 06:19

    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.

    0 讨论(0)
提交回复
热议问题