7

I am looking to take a full screenshot through a webpage, outside of the browser window. Basically, I am trying to build a help tool for both web-based apps and offline programs, and as a part of this I would like to be able to take screenshots from a webpage so the user does not have to download a program to take a screenshot/upload it to our website.

I am aware there may not be a solution to this, but if there was that would be awesome!

Cheers in advance

slyaer
  • 241
  • 4
  • 10
  • 2
    That would be a security issue. I would hope that it's not possible. – idbehold May 21 '13 at 00:47
  • You are right, it would be freaky if a random website took a photo of your personal desktop... I believe that would be a lesser issue if the whole screenshot was implemented through a browser plugin? – slyaer May 22 '13 at 05:45
  • Does this answer your question? [Using HTML5/Canvas/JavaScript to take in-browser screenshots](https://stackoverflow.com/questions/4912092/using-html5-canvas-javascript-to-take-in-browser-screenshots) – Anderson Green Jan 08 '22 at 12:04

2 Answers2

7

There are ways to achieve what you want to do in part. However, it is important to know that they do require user permissions.

You also ask if a web page can take a screenshot outside of a browser window- this is a huge breach of privacy and I would advise against implementing anything that goes down this route. For what your trying to do, it is always best to have user consent.

If you interest is in saving the user time and giving the user a more seamless experience, consider one or more of these options:

  1. You can use one of several JavaScript plugins/ API's to allow to user to select portions of what they see on the web page and then upload it to you. For instance, you can do this on YouTube. Go to youtube.com and scroll to the bottom of the page and click Help and then Send feedback. Here you can enter text as well as "highlight" portions of the page and send them to YouTube. To achieve something like this, look into something like html2canvas.

  2. Give your user quick access to the download pages for tools like Snipping Tool for Windows. This way, if they don't have it on their machine already, at least they don't have to go looking for it.

  3. From my experience in dealing with customers, many of them don't even know that things like Snipping Tool exist on their machine. Perhaps, an FAQ or help section that would guide the user would be useful.

In summary, it is possible through a web page to "screenshot" what is on a web page itself but nothing I have come across that allows you to capture anything outside of the web browsers context.

karancan
  • 2,152
  • 4
  • 23
  • 35
  • Thanks for your help. I'll probably go down the path you suggested. – slyaer May 22 '13 at 05:43
  • 2
    To point 1: there are drop in solutions like [Usersnap](http://www.usersnap.com) to get such Feedback for your own web app. – Gregor Jun 19 '13 at 15:55
  • +1 Thanks, excellent Question & Answer.. Love the `html2canvas` plugin, amazing stuff! – Anil Jun 27 '13 at 13:24
  • Do you happen to know whether it's a privacy violation to take a screenshot of just your own website in the browser client using html5 canvas? I know that you're not a lawyer and wouldn't consider this legal advice, just wondering whether you know anything off hand or have seen any companies do this. I'm interested in taking a screenshot of their screen when they submit a support ticket for support purposes. – kalenjordan Dec 02 '13 at 21:48
  • Any screenshot of a clients screen even if it your site wouldn't be a good idea without consent. For instance, they could be on your site but could be typing in a date of birth or something else confidential. At that point, there is a lot of liability on your end. Consent is key. – karancan Dec 03 '13 at 01:20
1

This is definitively not possible using only HTML5/JavaScript. You would have to involve a browser plugin such as Flash, a Java applet or perhaps a Firefox add-on.

Note: I'm assuming you mean taking a screenshot of the entire monitor, not just the browser window.

Hubro
  • 56,214
  • 69
  • 228
  • 381
  • You got it right, so a browser plugin/addon may work? Thanks for your help. – slyaer May 22 '13 at 05:42
  • @user1497307: I'm fairly sure that a Java applet pretty much gives you full control of the client's PC, so taking a screenshot is probably not an issue. Keep in mind that the user has to explicitly allow the Java applet to run, and that many users may not have Java installed. There could also be cross-platform complications. – Hubro May 22 '13 at 05:47
  • Thanks for that. I'll give it a go and see what happens. – slyaer Jul 18 '13 at 04:41