Kind of sad that it’s 2025 and we still don’t have a reliable way to screenshot DOM elements via JS.

Using an SVG with a foreignObject and drawing that to a canvas gets close, but getting external resources like fonts and images to load is a pain. πŸ˜… Not to mention things like checked checkboxes.

There’s a way to use getDisplayMedia() and restrict that to a specific element, but the API is desktop Chrome-only. πŸ˜•

0

If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.design/users/amxmln/statuses/114831195508097837 on your instance and quote it. (Note that quoting is not supported in Mastodon.)