fix(capture): apply device viewport before recording starts#809
Closed
Kikobeats wants to merge 1 commit into
Closed
fix(capture): apply device viewport before recording starts#809Kikobeats wants to merge 1 commit into
Kikobeats wants to merge 1 commit into
Conversation
Tab capture pins exact width/height from the target device, so `getUserMedia` overconstrains and fails with OverconstrainedError when the page still has the browser's default viewport. `resolveViewport` computed the device viewport but never applied it before the extension mode started recording. Rename to `prepareViewport` and `page.setViewport(device.viewport)` before any mode starts, so the page always matches the constraints. Navigation still runs after recording starts, so load animations are captured from t=0. This centralizes the viewport application for all modes, making the frame recorder's own setViewport redundant. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tab capture pins exact width/height from the target device, so
getUserMediaoverconstrains and fails with OverconstrainedError when the page still has the browser's default viewport.resolveViewportcomputed the device viewport but never applied it before the extension mode started recording.Rename to
prepareViewportandpage.setViewport(device.viewport)before any mode starts, so the page always matches the constraints. Navigation still runs after recording starts, so load animations are captured from t=0. This centralizes the viewport application for all modes, making the frame recorder's own setViewport redundant.Note
Low Risk
Small, localized change to capture startup ordering with a new regression test; no auth or data-path impact.
Overview
Fixes extension tab capture failing with
OverconstrainedErrorwhen a customdevice/viewportdoes not match the page’s default size. Tab capture’sgetUserMediaconstraints are pinned to the target device dimensions, so the page must already use that viewport beforeSTART_RECORDINGruns.prepareViewport(renamed fromresolveViewport) is now async and callspage.setViewport(device.viewport)increate-capturefor all capture modes before any recorder starts. The frame recorder no longer applies the viewport itself (comments updated to reflect centralization). Navigation still begins after recording starts so load animations are captured from t=0.Adds a test that asserts the device viewport is set at
START_RECORDINGtime.Reviewed by Cursor Bugbot for commit b28298e. Bugbot is set up for automated code reviews on this repo. Configure here.