I am building an online app and on click of a button I want to be able to screenshot what the user sees in their browser(my app). I've looked at lots of js libraries such as html2canvas, CCapture as dom-to-image but my page will have a mixture of html, svg, canvas and webgl content and none of the solutions I have found seem to capture it perfectly.
I then came across the Screen Capture API and getDisplayMedia.
All examples I can find always ask which tab/application/screen you want to share then have a live stream of your chosen page.
Ideally I don't want the user to do anything other than click the capture button and it to capture a single image (data url) of the page that the user initiated the function on. I can then use that dataurl elsewhere.
Any advise would be greatly appreciated