🎥 Make videos programmatically with React
Canvas Capture: Require Chrome 157 or newer
Jonny Burgera1ea99dffe4d
diff --git a/.agents/skills/canvas-capture-extension/SKILL.md b/.agents/skills/canvas-capture-extension/SKILL.mdindex c0aa4fa4be..85dec9e94f 100644--- a/.agents/skills/canvas-capture-extension/SKILL.md+++ b/.agents/skills/canvas-capture-extension/SKILL.md@@ -22,10 +22,9 @@ the unpacked copy outside the checkout so deleting a worktree cannot break it.The script builds with Bun and installs the complete WXT bundle in`/Users/jonathanburger/Applications/Remotion Canvas Capture Extension`.- Before building, it verifies that the pinned Chrome for Testing- `150.0.7842.0` (`r1631007`) is installed. If the browser is installed outside- the documented location, pass `--browser-executable <path>`. If it is missing- or incompatible, use `$install-canvas-capture-browser` to install it.+ Building does not require an installed browser. To use the extension, choose+ Chrome 157 or newer with Canvas Draw Element enabled. If no compatible browser+ is installed, use `$install-canvas-capture-browser` to install one.3. Confirm that the installed directory contains `manifest.json`,`background.js`, `capture.js`, `logo.svg`, `content-scripts/receiver.js`,@@ -38,7 +37,7 @@ the unpacked copy outside the checkout so deleting a worktree cannot break it.2. From `packages/canvas-capture-extension`, run `bun run dev`.3. WXT writes the development bundle to the durable directory`/Users/jonathanburger/Applications/Remotion Canvas Capture Extension Dev`,- launches the pinned Chrome for Testing with the Canvas Draw Element feature+ launches Chrome for Testing with the Canvas Draw Element featureenabled, and loads the extension automatically.4. Click the extension icon to show the in-page controls. Source and manifestchanges cause WXT to rebuild and reload the affected extension contexts.@@ -46,9 +45,14 @@ the unpacked copy outside the checkout so deleting a worktree cannot break it.Use the separate development directory only for `bun run dev`. Continue usingthe production install directory above for manually loaded builds.-## Reload in Chrome for Testing+To select another Chrome 157 or newer browser, set+`CANVAS_CAPTURE_BROWSER_EXECUTABLE` to its executable path when running+`bun run dev`. Development uses the version-neutral+`~/Library/Application Support/Remotion Canvas Capture` profile.-- Launch the pinned Chrome for Testing `150.0.7842.0` (`r1631007`) with the+## Reload in Chrome++- Launch Chrome 157 or newer with thededicated Canvas Capture profile, then open `chrome://extensions` manually.- Enable **Developer mode** on `chrome://extensions`.- If **Remotion Canvas Capture** already points to the durable directory, clickdiff --git a/.agents/skills/canvas-capture-extension/scripts/rebuild-extension.sh b/.agents/skills/canvas-capture-extension/scripts/rebuild-extension.shindex f1235d9181..92c436e81f 100755--- a/.agents/skills/canvas-capture-extension/scripts/rebuild-extension.sh+++ b/.agents/skills/canvas-capture-extension/scripts/rebuild-extension.sh@@ -4,13 +4,9 @@ set -euo pipefailrepo_dir=""install_dir="/Users/jonathanburger/Applications/Remotion Canvas Capture Extension"-browser_executable="/Users/jonathanburger/Applications/Recorder Chrome.app/Contents/MacOS/Google Chrome for Testing"-expected_browser_version="150.0.7842.0"-expected_browser_revision="r1631007"-browser_download_url="https://storage.googleapis.com/chrome-for-testing-per-commit-public/mac-arm64/r1631007/chrome-mac-arm64.zip"usage() {- printf '%s\n' "Usage: rebuild-extension.sh [--repo PATH] [--install-dir PATH] [--browser-executable PATH]"+ printf '%s\n' 'Usage: rebuild-extension.sh [--repo PATH] [--install-dir PATH]'}while (($# > 0)); do@@ -23,10 +19,6 @@ while (($# > 0)); doinstall_dir="${2:?--install-dir requires a path}"shift 2;;- --browser-executable)- browser_executable="${2:?--browser-executable requires a path}"- shift 2- ;;--help | -h)usageexit 0@@ -59,26 +51,6 @@ if [[ ! -f "$package_dir/package.json" || ! -f "$package_dir/wxt.config.ts" ]];exit 1fi-if [[ ! -x "$browser_executable" ]]; then- printf 'Chrome for Testing was not found at: %s\n' "$browser_executable" >&2- printf 'Canvas Capture requires Chrome for Testing %s (revision %s).\n' "$expected_browser_version" "$expected_browser_revision" >&2- printf 'Download it from: %s\n' "$browser_download_url" >&2- printf '%s\n' 'After installing it, rerun this command. For a different location, pass --browser-executable PATH.' >&2- exit 1-fi--browser_version="$("$browser_executable" --version 2>&1 || true)"-browser_version="${browser_version%"${browser_version##*[![:space:]]}"}"-expected_browser_description="Google Chrome for Testing $expected_browser_version"-if [[ "$browser_version" != "$expected_browser_description" ]]; then- printf '%s\n' 'The installed browser is incompatible with Canvas Capture.' >&2- printf 'Expected: %s (revision %s)\n' "$expected_browser_description" "$expected_browser_revision" >&2- printf 'Found: %s\n' "${browser_version:-unknown browser or version}" >&2- printf 'Download the required browser from: %s\n' "$browser_download_url" >&2- printf '%s\n' 'Then rerun this command, passing --browser-executable PATH if it is installed in a different location.' >&2- exit 1-fi-if ! command -v bun >/dev/null 2>&1; thenprintf '%s\n' 'Bun is required to build the extension.' >&2exit 1@@ -100,4 +72,5 @@ mkdir -p "$install_dir"rsync -a --delete "$dist_dir/" "$install_dir/"printf 'Installed Remotion Canvas Capture in %s\n' "$install_dir"+printf '%s\n' 'Canvas Capture requires Chrome 157 or newer with Canvas Draw Element enabled.'printf '%s\n' 'Open chrome://extensions manually, then click Reload or choose Load unpacked for this directory.'diff --git a/.agents/skills/install-canvas-capture-browser/SKILL.md b/.agents/skills/install-canvas-capture-browser/SKILL.mdindex 4296fd37bf..7e54d91211 100644--- a/.agents/skills/install-canvas-capture-browser/SKILL.md+++ b/.agents/skills/install-canvas-capture-browser/SKILL.md@@ -1,13 +1,14 @@---name: install-canvas-capture-browser-description: Install and verify the pinned Chrome for Testing build used by the private Remotion Canvas Capture extension on Apple Silicon macOS. Use when setting up Canvas Capture, when Recorder Chrome is missing or has the wrong version, or when the canvas-capture-extension installer reports that Chrome for Testing 150.0.7842.0 (r1631007) is unavailable.+description: Install and verify Chrome for Testing 157 or newer for the private Remotion Canvas Capture extension on Apple Silicon macOS. Use when setting up Canvas Capture or when no compatible Chrome browser is installed.---# Install Canvas Capture Browser-Install the exact Chrome for Testing build known to support Canvas Draw Element-and proprietary H.264 codecs. Keep it pinned because other Chrome builds may-remove or change the experimental API.+Canvas Capture requires Chrome 157 or newer with Canvas Draw Element enabled.+Use an existing compatible Chrome browser, or install Chrome for Testing with+the bundled script. The extension also checks the required HTML-in-canvas API+and video encoding configuration before allowing recording.## Install@@ -17,25 +18,22 @@ remove or change the experimental API..agents/skills/install-canvas-capture-browser/scripts/install-browser.sh```- The script only supports Apple Silicon macOS. It downloads revision- `r1631007`, verifies the archive checksum and version `150.0.7842.0`, and+ The script only supports Apple Silicon macOS. It selects the first compatible+ Stable, Beta, Dev, or Canary release from Google's Chrome for Testing metadata,+ verifies that the downloaded app matches that release, andinstalls the app at `/Users/jonathanburger/Applications/Recorder Chrome.app`.- It exits successfully without downloading when the correct version is+ It exits successfully without downloading when version 157 or newer isalready installed. It does not overwrite an incompatible existing app.-2. Confirm the script reports the expected installed path and version.+2. Confirm the script reports the expected installed path and a version of at least 157.3. Launch it for Canvas Capture with:```bash'/Users/jonathanburger/Applications/Recorder Chrome.app/Contents/MacOS/Google Chrome for Testing' \- --user-data-dir='/Users/jonathanburger/Library/Application Support/Chrome for Testing Canvas Capture r1631007' \+ --user-data-dir='/Users/jonathanburger/Library/Application Support/Remotion Canvas Capture' \--enable-features=CanvasDrawElement \--enable-blink-features=CanvasDrawElement \- --disable-component-update \--no-first-run \--no-default-browser-check```--Use this browser only with trusted websites because the pinned build does not-receive security updates.diff --git a/.agents/skills/install-canvas-capture-browser/agents/openai.yaml b/.agents/skills/install-canvas-capture-browser/agents/openai.yamlindex a775a6c91e..87f88f1c0f 100644--- a/.agents/skills/install-canvas-capture-browser/agents/openai.yaml+++ b/.agents/skills/install-canvas-capture-browser/agents/openai.yaml@@ -1,4 +1,4 @@interface:display_name: 'Install Canvas Capture Browser'- short_description: 'Install the pinned Canvas Capture browser'- default_prompt: 'Use $install-canvas-capture-browser to install the pinned Chrome for Testing build for Canvas Capture.'+ short_description: 'Install Chrome 157 or newer for Canvas Capture'+ default_prompt: 'Use $install-canvas-capture-browser to install Chrome for Testing 157 or newer for Canvas Capture.'diff --git a/.agents/skills/install-canvas-capture-browser/scripts/install-browser.sh b/.agents/skills/install-canvas-capture-browser/scripts/install-browser.shindex cdd4340f07..7ede02696d 100755--- a/.agents/skills/install-canvas-capture-browser/scripts/install-browser.sh+++ b/.agents/skills/install-canvas-capture-browser/scripts/install-browser.sh@@ -2,10 +2,8 @@set -euo pipefail-expected_version="150.0.7842.0"-expected_revision="r1631007"-expected_sha256="86de7ffdb70d3f41714bf5b2b6fe3ef23cbf6c924eb407343418f31b9c721f7f"-download_url="https://storage.googleapis.com/chrome-for-testing-per-commit-public/mac-arm64/r1631007/chrome-mac-arm64.zip"+minimum_version=157+metadata_url="https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json"install_app="${HOME:?}/Applications/Recorder Chrome.app"usage() {@@ -31,7 +29,7 @@ while (($# > 0)); dodoneif [[ "$(uname -s)" != "Darwin" || "$(uname -m)" != "arm64" ]]; then- printf '%s\n' 'Canvas Capture requires Apple Silicon macOS for this pinned browser build.' >&2+ printf '%s\n' 'This Chrome for Testing installer requires Apple Silicon macOS.' >&2exit 1fi@@ -39,13 +37,14 @@ installed_plist="$install_app/Contents/Info.plist"installed_executable="$install_app/Contents/MacOS/Google Chrome for Testing"if [[ -e "$install_app" ]]; theninstalled_version="$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "$installed_plist" 2>/dev/null || true)"- if [[ "$installed_version" == "$expected_version" && -x "$installed_executable" ]]; then- printf 'Chrome for Testing %s (%s) is already installed at %s\n' "$expected_version" "$expected_revision" "$install_app"+ installed_major="${installed_version%%.*}"+ if [[ "$installed_major" =~ ^[0-9]+$ && -x "$installed_executable" ]] && ((installed_major >= minimum_version)); then+ printf 'Chrome for Testing %s is already installed at %s\n' "$installed_version" "$install_app"exit 0fiprintf 'Cannot install because an incompatible app already exists at: %s\n' "$install_app" >&2- printf 'Expected Chrome for Testing %s (%s), found version: %s\n' "$expected_version" "$expected_revision" "${installed_version:-unknown}" >&2+ printf 'Expected Chrome for Testing %s or newer, found version: %s\n' "$minimum_version" "${installed_version:-unknown}" >&2printf '%s\n' 'Move or remove that app after confirming it is safe to do so, then rerun this installer.' >&2exit 1fi@@ -58,21 +57,47 @@ cleanup() {}trap cleanup EXIT+metadata_path="$temporary_dir/chrome-for-testing.json"+curl --fail --location --silent --show-error "$metadata_url" --output "$metadata_path"++download_url=""+expected_version=""+selected_channel=""+for channel in Stable Beta Dev Canary; do+ candidate_version="$(plutil -extract "channels.$channel.version" raw -o - "$metadata_path" 2>/dev/null || true)"+ candidate_major="${candidate_version%%.*}"+ if [[ ! "$candidate_major" =~ ^[0-9]+$ ]] || ((candidate_major < minimum_version)); then+ continue+ fi++ index=0+ while candidate_platform="$(plutil -extract "channels.$channel.downloads.chrome.$index.platform" raw -o - "$metadata_path" 2>/dev/null)"; do+ if [[ "$candidate_platform" == "mac-arm64" ]]; then+ download_url="$(plutil -extract "channels.$channel.downloads.chrome.$index.url" raw -o - "$metadata_path")"+ expected_version="$candidate_version"+ selected_channel="$channel"+ break+ fi+ index=$((index + 1))+ done++ if [[ -n "$download_url" ]]; then+ break+ fi+done++if [[ -z "$download_url" ]]; then+ printf 'No Chrome for Testing %s or newer download is available for mac-arm64.\n' "$minimum_version" >&2+ exit 1+fi+archive_path="$temporary_dir/chrome-mac-arm64.zip"extracted_dir="$temporary_dir/extracted"source_app="$extracted_dir/chrome-mac-arm64/Google Chrome for Testing.app"-printf 'Downloading Chrome for Testing %s (%s)…\n' "$expected_version" "$expected_revision"+printf 'Downloading Chrome for Testing %s (%s)…\n' "$expected_version" "$selected_channel"curl --fail --location --progress-bar "$download_url" --output "$archive_path"-actual_sha256="$(shasum -a 256 "$archive_path" | cut -d ' ' -f 1)"-if [[ "$actual_sha256" != "$expected_sha256" ]]; then- printf '%s\n' 'The downloaded Chrome for Testing archive failed checksum verification.' >&2- printf 'Expected SHA-256: %s\n' "$expected_sha256" >&2- printf 'Found SHA-256: %s\n' "$actual_sha256" >&2- exit 1-fi-mkdir -p "$extracted_dir"ditto -x -k "$archive_path" "$extracted_dir"@@ -80,7 +105,7 @@ source_plist="$source_app/Contents/Info.plist"source_executable="$source_app/Contents/MacOS/Google Chrome for Testing"downloaded_version="$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "$source_plist" 2>/dev/null || true)"if [[ "$downloaded_version" != "$expected_version" || ! -x "$source_executable" ]]; then- printf '%s\n' 'The verified archive did not contain the required Chrome for Testing app.' >&2+ printf '%s\n' 'The downloaded archive did not contain the expected Chrome for Testing app.' >&2printf 'Expected version: %s\n' "$expected_version" >&2printf 'Found version: %s\n' "${downloaded_version:-unknown}" >&2exit 1@@ -95,4 +120,4 @@ if [[ "$installed_version" != "$expected_version" || ! -x "$installed_executableexit 1fi-printf 'Installed Chrome for Testing %s (%s) at %s\n' "$expected_version" "$expected_revision" "$install_app"+printf 'Installed Chrome for Testing %s at %s\n' "$expected_version" "$install_app"diff --git a/packages/canvas-capture-extension/README.md b/packages/canvas-capture-extension/README.mdindex ef3b7f818d..7406889210 100644--- a/packages/canvas-capture-extension/README.md+++ b/packages/canvas-capture-extension/README.md@@ -2,11 +2,17 @@Record an area—or a whole webpage—as a high-resolution H.264 MP4 or VP9 WebM using Chromium's experimental HTML-in-canvas implementation.-## Pinned browser setup on macOS+## Browser setup on macOS-Use [Chrome for Testing `150.0.7842.0` at revision `r1631007`](https://storage.googleapis.com/chrome-for-testing-per-commit-public/mac-arm64/r1631007/chrome-mac-arm64.zip) on Apple Silicon. This is the exact Chromium revision where the required HTML-in-canvas implementation is known to work. Chrome for Testing does not auto-update, and unlike an open-source Chromium build, it is built with proprietary codec support so the browser can both encode and play the H.264 MP4 produced by this extension.+Canvas Capture requires Chrome 157 or newer on Apple Silicon, with Canvas Draw Element enabled. You can use Chrome, Chrome Canary, or Chrome for Testing as long as the browser meets this minimum. The extension also checks whether the HTML-in-canvas API and video encoding configuration are available before recording.-After extracting the archive, move and rename the app to a durable location such as:+To install a compatible Chrome for Testing build, run:++```bash+.agents/skills/install-canvas-capture-browser/scripts/install-browser.sh+```++The installer uses a compatible release from Google's Chrome for Testing channels and installs it at:```text/Users/jonathanburger/Applications/Recorder Chrome.app@@ -16,10 +22,9 @@ Launch it with a dedicated profile and the HTML-in-canvas feature enabled:```bash'/Users/jonathanburger/Applications/Recorder Chrome.app/Contents/MacOS/Google Chrome for Testing' \- --user-data-dir='/Users/jonathanburger/Library/Application Support/Chrome for Testing Canvas Capture r1631007' \+ --user-data-dir='/Users/jonathanburger/Library/Application Support/Remotion Canvas Capture' \--enable-features=CanvasDrawElement \--enable-blink-features=CanvasDrawElement \- --disable-component-update \--no-first-run \--no-default-browser-check```@@ -30,8 +35,6 @@ Load the unpacked extension from the durable installation directory:/Users/jonathanburger/Applications/Remotion Canvas Capture Extension```-Do not replace this browser with Chrome Canary or a normal Chrome installation: those update automatically and may remove or change the experimental API. Because this browser is intentionally pinned and will not receive security updates, only use it with trusted websites.-## DevelopmentClose Recorder Chrome if it is already using the dedicated Canvas Capture@@ -44,9 +47,16 @@ bun run devWXT starts Vite, writes the development extension to the durable`/Users/jonathanburger/Applications/Remotion Canvas Capture Extension Dev`-directory, launches the pinned Chrome for Testing with the required feature+directory, launches Chrome for Testing with the required featureflags and persistent profile, and loads the extension automatically.+To use another Chrome 157 or newer executable, set+`CANVAS_CAPTURE_BROWSER_EXECUTABLE` when starting development:++```bash+CANVAS_CAPTURE_BROWSER_EXECUTABLE='/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary' bun run dev+```+Open a regular webpage and click the extension icon to show the in-page capturecontrols. WXT rebuilds and reloads the relevant extension contexts when sourcefiles change.@@ -56,8 +66,8 @@ extension, so its path and extension ID remain stable across worktrees.## Build and install-1. From the repository root, run `.agents/skills/canvas-capture-extension/scripts/rebuild-extension.sh --repo "$PWD"`. This verifies the pinned Chrome for Testing version, creates the production WXT bundle, and installs the complete unpacked extension outside the worktree. If the browser is not at the path shown above, also pass `--browser-executable <path>`.-2. Open `chrome://extensions`, enable **Developer mode**, and choose **Load unpacked**.+1. From the repository root, run `.agents/skills/canvas-capture-extension/scripts/rebuild-extension.sh --repo "$PWD"`. This creates the production WXT bundle and installs the complete unpacked extension outside the worktree. Building does not require an installed browser.+2. In Chrome 157 or newer, open `chrome://extensions`, enable **Developer mode**, and choose **Load unpacked**.3. Select `/Users/jonathanburger/Applications/Remotion Canvas Capture Extension`.4. Enable `chrome://flags/#canvas-draw-element` and restart Chrome if HTML-in-canvas is not already enabled.diff --git a/packages/canvas-capture-extension/README.public.md b/packages/canvas-capture-extension/README.public.mdindex 1220a3dd7c..10fb6bf624 100644--- a/packages/canvas-capture-extension/README.public.md+++ b/packages/canvas-capture-extension/README.public.md@@ -6,6 +6,8 @@ HTML-in-canvas implementation.## Install+Canvas Capture requires Chrome 157 or newer with Canvas Draw Element enabled on an Apple Silicon Mac.+Follow the [Canvas Capture installation guide](https://www.remotion.dev/docs/canvas-capture/installation).## Developmentdiff --git a/packages/canvas-capture-extension/wxt.config.ts b/packages/canvas-capture-extension/wxt.config.tsindex 1b08374497..594ac0a972 100644--- a/packages/canvas-capture-extension/wxt.config.ts+++ b/packages/canvas-capture-extension/wxt.config.ts@@ -22,6 +22,7 @@ export default defineConfig({description:'Record any element on a webpage as a high-resolution MP4 or WebM.',version: '0.1.0',+ minimum_chrome_version: '157',permissions: ['activeTab', 'scripting', 'storage', 'unlimitedStorage'],icons: {16: 'icons/icon-16.png',@@ -41,25 +42,26 @@ export default defineConfig({},webExt: {binaries: {- chrome: path.join(- homeDirectory,- 'Applications',- 'Recorder Chrome.app',- 'Contents',- 'MacOS',- 'Google Chrome for Testing',- ),+ chrome:+ process.env.CANVAS_CAPTURE_BROWSER_EXECUTABLE ??+ path.join(+ homeDirectory,+ 'Applications',+ 'Recorder Chrome.app',+ 'Contents',+ 'MacOS',+ 'Google Chrome for Testing',+ ),},chromiumArgs: [`--user-data-dir=${path.join(homeDirectory,'Library','Application Support',- 'Chrome for Testing Canvas Capture r1631007',+ 'Remotion Canvas Capture',)}`,'--enable-features=CanvasDrawElement','--enable-blink-features=CanvasDrawElement',- '--disable-component-update','--no-first-run','--no-default-browser-check',],diff --git a/packages/docs/docs/canvas-capture/installation.mdx b/packages/docs/docs/canvas-capture/installation.mdxindex 2bfd8e1c73..abcb9aaab5 100644--- a/packages/docs/docs/canvas-capture/installation.mdx+++ b/packages/docs/docs/canvas-capture/installation.mdx@@ -8,7 +8,7 @@ sidebar_label: Installation> Tip: Copy the URL of this page into an agent to let it install it for you.-Canvas Capture currently requires an Apple Silicon Mac.+Canvas Capture requires an Apple Silicon Mac and Chrome 157 or newer with Canvas Draw Element enabled.## Download the extension@@ -21,24 +21,24 @@ git clone --depth=1 https://github.com/remotion-dev/canvas-capture.git \The repository contains a production build of Canvas Capture. You do not need to clone or build Remotion.-## Install Chrome for Testing+## Choose a browser-Canvas Capture uses Chrome for Testing `150.0.7842.0` at revision `r1631007`. This is the exact version known to support the required HTML-in-canvas API.+Use Chrome, Chrome Canary, or Chrome for Testing version 157 or newer. Check your version at `chrome://version`.-Install the browser using the script included with Canvas Capture:+If you need a compatible browser, install Chrome for Testing using the script included with Canvas Capture. The installer selects a release that meets the minimum version:```bash title="Terminal""$HOME/Applications/Remotion Canvas Capture Extension/install-browser.sh"```-This browser does not receive security updates. Only use it with websites you trust.-## Launch the browser-Open Google Chrome for Testing from Launchpad.+Open your chosen browser. If you used the installer, open Google Chrome for Testing from Launchpad.Open `chrome://flags`, search for Canvas Draw Element, set it to Enabled and select Relaunch.+The extension checks whether the required HTML-in-canvas API and video encoding configuration are available before allowing recording.+## Load the extensionOpen `chrome://extensions`, enable Developer mode and select Load unpacked.