/claim #6775
This PR fixes the performance issue where canvas snapshotting on Safari takes >20ms, leading to significant frame drops in session recordings.
The core issue is that Safari 16.x has a blocking/poorly performing implementation of createImageBitmap when the resizeWidth/Height parameters are used.
To solve this, I’ve implemented a manual resizing pipeline in CanvasManager:
resizeWidth/Height in createImageBitmap, we now use a temporary OffscreenCanvas (or a standard canvas as a fallback).drawImage with imageSmoothingEnabled: true.createImageBitmap on the already-resized temporary canvas without any resizing parameters.This bypasses the blocking behavior in WebKit and restores performance to <1ms levels, matching Chrome’s behavior.
rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.ts: Source logic for the rrweb submodule.__generated/rr/rrweb/rr.js: Updated the bundled JS to ensure the fix is immediately active in the highlight frontend.i2you
@i2you
Highlight (YC W23)
@highlight