Take a screenshot of the entire screen using html5 / javascript?

I want to take a full screen shot through a web page outside of the browser window. Basically, I am trying to create a help tool for both web applications and stand-alone programs, and as part of this I would like to be able to take screenshots from a web page, so the user does not need to upload a screenshot program / upload it to our website .

I know that maybe not a solution, but if it were awesome!

Greetings in advance

+6
source share
2 answers

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

You also ask if a webpage can take a screenshot outside the browser window - this is a serious violation of privacy, and I would advise against using everything that goes along this path. For what you are trying to do, it is always better to have user consent.

If you are interested in saving user time and providing the user with a more seamless experience, consider one or more of these options:

  • You can use one of several JavaScript plugins / APIs to allow the user to select parts of what they see on a web page and then download them to you. For example, you can do this on YouTube. Go to youtube.com and scroll to the end and click Help and then Send feedback . Here you can enter text, as well as "highlight" parts of the page and send them to YouTube. To achieve something similar, look at html2canvas .

  • Provide the user with quick access to download pages for tools such as the Snipping Tool for Windows. Thus, if they no longer have it in their car, at least they don’t need to look for it.

  • From my experience working with clients, many of them don’t even know that there are such things as the Snipping Tool on their machine. Perhaps a useful FAQ or help section is helpful that will guide the user.

Thus, through the web page, you can “take a screenshot” of what is on the web page itself, but nothing I came across allows you to capture anything outside the context of web browsers.

+7
source

This is finally not possible using only HTML5 / JavaScript. You will need to enable a browser plugin, such as Flash, a Java applet, or perhaps a Firefox add-on.

Note. I assume that you want to take a screenshot of the entire monitor, and not just the browser window.

+1
source

Source: https://habr.com/ru/post/945468/


All Articles