Re: [mediacapture-viewport] getViewportScreenshot (younger sibling of getViewportMedia) (#2)

I second what github-nilsson mentioned. It would be useful to be able to take a screenshot of a particular DOM element.

Addtionally, it would also be useful having the user to confirm this every time, provided certain security constraints such as no CORS or appropriate CORS headers are met. Workarounds such [dom-to-image](https://github.com/tsayen/dom-to-image) exist that don't need explicit permission for non-CORS content. If requiring user consent is deemed essential, then I think measures should also be taken to shut off what's already possible with those workarounds.

2 use cases:

* An interactive editor such as a form designer that lets users create forms via drag & drop. Take an image (thumbnail) of the form and save it in the backend. So it can e.g. be displayed later in the backend on a page with a list of all forms.
  * Workarounds exist, such as [dom-to-image](https://github.com/tsayen/dom-to-image) or [html2canvas](https://github.com/niklasvh/html2canvas).
* [Leaflet](https://leafletjs.com/) is a JavaScript library for rendering map data provided by a map data service. Take a screenshot of the currently displayed map.
  * Workarounds exists, such as [leaflet-simple-map-screenshoter](https://github.com/grinat/leaflet-simple-map-screenshoter)

-- 
GitHub Notification of comment by blutorange
Please view or discuss this issue at https://github.com/w3c/mediacapture-viewport/issues/2#issuecomment-3068961097 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 14 July 2025 10:51:52 UTC