Repository navigation
feat(chrome-extension): open the recorder on Cap pages when clicked on browser pages - #3550
Conversation
…lace of browser pages it cannot run on
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
hey @greptileai, please re-review the PR |
|
hey @greptileai, please re-review the PR |
| .toBe(true); | ||
| const panel = frameWithUrl(welcomePage, "popup.html"); | ||
| if (!panel) throw new Error("recorder panel missing"); | ||
| await panel.getByRole("button", { name: "Start recording" }).click(); |
There was a problem hiding this comment.
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.
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 --> panelmountPageNav(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.isRecorderHostPage,src/shared/recorder-pages.ts) and accepts their overlay tokens only from the top frame, so a hostile site embedding the web-accessiblewelcome.htmlstill cannot register one.openRecorderOnCapPagereplaces an empty New Tab with the how-it-works page, or opens it beside any other browser page. The page sendsshow-recorder-panelonce (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.activeTab, which is what exposes the clicked tab's URL for the New Tab check. No new permissions.

Confidence 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.
Reviews (3) · Last reviewed commit: "test(chrome-extension): cover replacing ..." · Reviewed by Greptile