demo · v132

Pick a DOM subtree, send only that to the capture stream

Same page, three regions: sidebar, main, toolbar. Mark one with RestrictionTarget.fromElement(), call BrowserCaptureMediaStreamTrack.restrictTo(), and the screen-share track surfaces only the marked subtree. Click a region to pick it.

checking support…

sidebar (id="sidebar")

  • • Inbox
  • • Sent
  • • Drafts

main (id="main")

This is the main pane. Imagine an editor here.

toolbar (id="toolbar")

BIU

capture preview

currently restricted to: whole tab

idle
This demo needs you to share this tab when prompted. RestrictionTarget and BrowserCaptureMediaStreamTrack need both the API support (Chrome 132+) AND a real getDisplayMedia() capture stream — the prompt is unavoidable in browsers.

see also