Transport lab 2: newer routes

More routes for getting a drawn element to another thread, document or device, using APIs from Chrome 130 to 160: WebRTC sender settings that keep text sharp, an RTCDataChannel moved to a worker, SharedArrayBuffer under Document-Isolation-Policy, WebTransport datagrams and Element Capture. The first lab has the other fifty.

Each row is a test that runs in this browser. Nothing runs until you press the button, and each row removes its canvas before the next one starts.

Show the code the helpers the rows share

Every row has its own Show the code link with the function it ran. They use these.

  1. source(): a drawable canvas with one element drawn into it.
  2. loopback(): two RTCPeerConnections in this page, joined to each other. It stands in for two devices.
  3. The worker that takes the data channel and reads the shared memory.
  4. The frame served with Document-Isolation-Policy.
  5. The freeze test.
  6. The timer that runs in a worker and in a SharedWorker.
  7. freeze-log.js: record when the browser stopped the page.

A · WebRTC sender settings for a stream of text, not of camera video

B · Workers and shared memory

C · WebTransport

D · Element Capture needs a press and a permission prompt

Element Capture records the tab and crops the track to one element. It's the browser's own way to share one element, so it's compared here with canvas.captureStream() of a canvas that draws the element. The three targets below must be on screen to be captured.

plain div
canvas child

E · When the browser freezes the source tab

A page that streams an element only produces frames while it runs. Chrome on Android freezes a hidden tab after about a minute; desktop Chrome does it under Energy Saver. This test measures what stops. Press the button, switch to another tab or app for at least 90 seconds, then come back.

WhatLongest stopDetail
Timer on the pagenot runsetInterval, 250 ms
paint events of a drawable canvasnot runrequestPaint() on every timer tick
Timer in a dedicated workernot runwhere a worker-owned canvas would draw
Timer in a SharedWorkernot runthe broker of the cross-tab demo
WebSocket to this site's room servernot runthe signalling and relay route of the remote demo

What freeze-log.js has recorded for this tab:

Findings