Repository navigation
Split browser worker into focused runtime modules - #227
Merged
Merged
Conversation
|
- Scroll Verify and checkbox controls into view before every trusted pointer click, not only image-grid submission. - Treat any visible challenge widget without a token as unresolved, filtering on visibility so dormant provider frames do not mask it. - Wire the recording-busy helpers into parking and idle reaping; drop unused exports from the artifacts, snapshots, and realm factories. - Share isObjectValue from untrusted-value.ts; type the sandbox execution record directly instead of through an untyped parameter. - Hoist the local widget selector literal.
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.
What and why
Split the browser worker into focused internal modules for realms, sandbox composition, artifacts and recording, snapshots, live view, trusted input, site tools, sessions, and CAPTCHA handling. The entrypoint retains browser lifecycle, RPC wiring, session queues, network guards, execution ordering, downloads, and secret tracking. Factories own subsystem state and use live getters for changing browser/configuration references; ordering contracts are documented in
docs/worker-architecture.md.The browser regressions also fix two existing CAPTCHA bugs: trusted checkbox/Verify clicks scroll their targets into view, and unsuccessful image-grid picks cannot report a still-visible challenge as cleared without a response token.
Test reliability fixes:
Checklist
bun run release:checkpasses locally on286869b, including versions, full-repo lint, typechecks, build, unit tests, declarations, and package smoke.bun run test:typespasses against the existing declarations.CHANGELOG.mdrecords the refactor and CAPTCHA fixes; architecture and verification guidance are indocs/worker-architecture.md.How it was verified
BETTERWRIGHT_REQUIRE_BROWSER=1 BETTERWRIGHT_REQUIRE_RECORDING=1 bun run release:check: 1,345 tests passed, three optional live-provider skips; all static, declaration, build-layout, and package checks passed. Model configuration environment overrides were unset for the test process.bun tests/e2e/run.ts --binary bun --binary-arg "$PWD/dist/bin/betterwright.js" --require-all: 102 passed, zero failures or skips, using only committed fixtures. The final follow-up changes test isolation only; the browser runtime is unchanged.External CAPTCHA services, paid/remote providers, and Electron attachment were not exercised locally.