fix: load extensions in recorded tab by using default browser context#891
fix: load extensions in recorded tab by using default browser context#891v1s10n-4 wants to merge 2 commits intovercel-labs:mainfrom
Conversation
|
@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. |
ctate
left a comment
There was a problem hiding this comment.
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 inactions.rsande2e_tests.rs -
Fix e2e tests: content script isolated world issue — The test extension sets
window.__TEST_EXT = trueand checks it viaevaluate, but content scripts run in Chrome's isolated world —windowproperties they set are not visible from the main world whereRuntime.evaluateruns. The extension should modify the DOM instead (e.g.,document.documentElement.setAttribute('data-test-ext', 'true')) and assertions should checkdocument.documentElement.getAttribute('data-test-ext'), since DOM mutations are shared across worlds.
Thank you for the well-scoped contribution and the thorough regression tests!
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>
a2415b2 to
b041d53
Compare
Fixes #890
When
--extensionis used,record startandwindow_newnow 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.