← Back to release summary

Element Capture

Category
Multimedia
Type
New or changed feature
Status
In development (Chrome In development)
Intent stage
None

Summary

API for capturing a subtree of the DOM. Given a video MediaStreamTrack obtained through pre-existing means to initiate tab-capture, Element Capture allows mutating the track to only capture a subtree of the DOM starting at a given Element. The API bears some resemblance to the Region Capture API, but affords greater flexibility for applications, because occluding and occluded content are both excluded from the capture.

Motivation

Pre-existing mechanisms allow applications to capture the current tab and crop the resulting video track to the bounding box of a target-element. However: * If any elements occlude the target element, either partially or fully, they are included in the captured frames. * If any elements are partially-occluded by a partially transparent target-element, those partially-occluded elements will also be (partially) included in the captured frames. By allowing applications to restrict the capture to a subtree of the DOM rather than a subsection of the viewport, we allow the intentional exclusion of interfering content from the capture. This way, applications can robustly capture just the intended content, allowing them to offer a better experience to users.

Standards & signals

Samples: https://element-capture-demo.glitch.me

Explainers: https://github.com/screen-share/element-capture/blob/main/README.md

View on chromestatus.com