Skip to content

fix: load extensions in recorded tab by using default browser context#891

Open
v1s10n-4 wants to merge 2 commits intovercel-labs:mainfrom
v1s10n-4:fix/record-extension
Open

fix: load extensions in recorded tab by using default browser context#891
v1s10n-4 wants to merge 2 commits intovercel-labs:mainfrom
v1s10n-4:fix/record-extension

Conversation

@v1s10n-4
Copy link

Fixes #890

When --extension is used, record start and window_new now create pages in the default browser context instead of a new isolated context. Chrome extensions only run in the default context; CDP-created contexts are incognito-like and do not load extensions.

@vercel
Copy link
Contributor

vercel bot commented Mar 17, 2026

@v1s10n-4 is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Collaborator

@ctate ctate left a comment

Choose a reason for hiding this comment

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

Thanks for this fix! The approach is correct — I confirmed the bug by E2E testing on main (extension content script doesn't run in the recorded tab's isolated context) and verified the default-context path works. Two things before merge:

  • Run cargo fmt — 4 minor formatting deviations in actions.rs and e2e_tests.rs

  • Fix e2e tests: content script isolated world issue — The test extension sets window.__TEST_EXT = true and checks it via evaluate, but content scripts run in Chrome's isolated world — window properties they set are not visible from the main world where Runtime.evaluate runs. The extension should modify the DOM instead (e.g., document.documentElement.setAttribute('data-test-ext', 'true')) and assertions should check document.documentElement.getAttribute('data-test-ext'), since DOM mutations are shared across worlds.

Thank you for the well-scoped contribution and the thorough regression tests!

v1s10n-4 and others added 2 commits March 20, 2026 14:38
When `--extension` is used, `record start` and `window_new` now create
pages in the default browser context instead of a new isolated context.
Chrome extensions only run in the default context; CDP-created contexts
are incognito-like and do not load extensions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Unit tests in browser.rs: verify has_extensions is correctly derived
  from LaunchOptions (present, absent, empty vec)
- E2E tests: verify extensions are active in recorded tabs and new
  windows (regression tests for vercel-labs#890)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@v1s10n-4 v1s10n-4 force-pushed the fix/record-extension branch from a2415b2 to b041d53 Compare March 20, 2026 13:40
@v1s10n-4 v1s10n-4 requested a review from ctate March 20, 2026 13:48
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.

[Bug] Extensions not loaded in recorded tab (record start --extension)

2 participants