我希望通过浏览器窗口之外的网页截取完整的屏幕截图。基本上,我正在尝试为基于 Web 的应用程序和离线程序构建一个帮助工具,作为其中的一部分,我希望能够从网页中截取屏幕截图,这样用户就不必下载程序来获取截图/上传到我们的网站。
我知道可能没有解决方案,但如果有那就太棒了!
提前喝彩
我希望通过浏览器窗口之外的网页截取完整的屏幕截图。基本上,我正在尝试为基于 Web 的应用程序和离线程序构建一个帮助工具,作为其中的一部分,我希望能够从网页中截取屏幕截图,这样用户就不必下载程序来获取截图/上传到我们的网站。
我知道可能没有解决方案,但如果有那就太棒了!
提前喝彩
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:
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.
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.
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.
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.