Skip to content

feat(chrome-extension): open the recorder on Cap pages when clicked on browser pages - #3550

Merged
richiemcilroy merged 5 commits into
mainfrom
fix/chrome-extension-start-anywhere
Oct 29, 2026
Merged

richiemcilroy merged 5 commits into
mainfrom
fix/chrome-extension-start-anywhere

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Stacked on #3549.

Clicking Cap on a page where content scripts cannot run (New Tab, chrome:// settings, the Web Store, Cap's own welcome page right after install) used to open a detached popup window with no camera bubble, dock or countdown. The recorder now always opens in a page.

flowchart TD
  click[Cap icon clicked] --> inject{Overlay reaches the tab?}
  inject -- website or Cap page --> panel[Panel opens in that tab]
  inject -- browser page --> newtab{New Tab?}
  newtab -- yes --> replace[Replace it with how-it-works.html?recorder=open]
  newtab -- no --> beside[Open how-it-works.html?recorder=open beside it]
  replace --> show[Page sends show-recorder-panel]
  beside --> show
  show --> panel
Loading
  • Cap's own pages (welcome, how it works, camera access, options) load the content bootstrap through mountPageNav (src/shared/recorder-host.ts), so they host the same in-page recorder a website does. A new user who pins Cap and clicks it on the welcome page gets the panel and camera bubble right there.
  • The worker treats those pages as injectable (isRecorderHostPage, src/shared/recorder-pages.ts) and accepts their overlay tokens only from the top frame, so a hostile site embedding the web-accessible welcome.html still cannot register one.
  • When the overlay cannot reach the clicked tab, openRecorderOnCapPage replaces an empty New Tab with the how-it-works page, or opens it beside any other browser page. The page sends show-recorder-panel once (a non-toggling open, honoured only from Cap pages) and drops the flag from its URL. The popup window stays as the last resort if no tab can be opened.
  • The action click grants activeTab, which is what exposes the clicked tab's URL for the New Tab check. No new permissions.
Welcome page after install Clicked on a browser page
Welcome page with the recorder Recorder opened on a Cap page

RetriggerView in GreptileConfidence Score: 5/5

The changes since the previous review appear safe to merge, with no new actionable issues found.

Summary

The PR opens the recorder inside Cap pages when the clicked browser page cannot host it.

  • Cap opens the recorder on its own pages when browser tabs cannot host it.

Reviews (3) · Last reviewed commit: "test(chrome-extension): cover replacing ..." · Reviewed by Greptile

@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cap-status Skipped Skipped Oct 29, 2026 7:27pm UTC

@vercel
vercel Bot temporarily deployed to Preview – cap-status October 29, 2026 19:19 Inactive
@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

Comment thread apps/chrome-extension/src/shared/recorder-pages.ts Outdated
Comment thread apps/chrome-extension/e2e/overlay-ui.spec.ts
@vercel
vercel Bot temporarily deployed to Preview – cap-status October 29, 2026 19:27 Inactive
@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@richiemcilroy
richiemcilroy changed the base branch from fix/chrome-extension-reliability to main October 29, 2026 19:34
@richiemcilroy
richiemcilroy marked this pull request as ready for review October 29, 2026 19:34
@richiemcilroy
richiemcilroy merged commit c01f233 into main Oct 29, 2026
38 checks passed

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found 1 potential issue (1 medium).

Open in Capy

.toBe(true);
const panel = frameWithUrl(welcomePage, "popup.html");
if (!panel) throw new Error("recorder panel missing");
await panel.getByRole("button", { name: "Start recording" }).click();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome recording test never creates the auto-selected capture source

Medium Severity

launchExtensionContext() hard-codes both capture auto-selection flags to Cap Close UI Target, but this test opens only the popup and Welcome page, whose title is Welcome - Cap. Unlike the existing recording tests, it never loads /capture.html or creates another matching source. With the configured fullscreen mode, Start reaches getDisplayMedia() without a selectable matching source, so the recording-status assertion times out. Create a matching capture target before starting, or configure this test's auto-selection to match the Welcome page.

Open in Capy

This branch was successfully deployed

1 active (outdated) and 1 inactive deployments
Preview – cap-status — 5b98e6a2 Deployed Oct 29, 2026 by vercel[bot]
Preview – cap-web — 097ed75f Deployed Oct 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant