feat: add internal event-driven URL waits
SU
1mo ago+457+457+012345678901234567890123456789-26-26-01234567890123456789
why
Add passive URL waiting as an internal extension capability, separate from publishing a new SDK operation.
This is PR1 of the waitForURL() stack. SDK follow-up #3185 targets this branch and adds protocol/RPC registration, TypeScript/Python wrappers, docs, generated models, and browser integration coverage.
what changed
- Observe main-frame full and same-document navigations; check the current URL after subscribing so an already-matching URL works without a polling loop.
- Match full-URL string globs:
*excludes slashes and**includes them. All other characters are literal. - Reuse the existing lifecycle waiter with one Progress deadline, cancellation, stale-loader filtering, and a document identity recheck after readiness.
- Keep
timeout: 0unlimited while still rejecting on page/transport closure. - Support
loadanddomcontentloadedonly.networkidleis deliberately not exposed because the current passive idle implementation cannot reliably handle an already-idle document. - Rebase on current main without restoring the retired Go SDK or its embedded archive; no RPC or SDK method is exposed here.
Reviewed with the requested Thermo-Nuclear Code Quality Review skill: reuse canonical lifecycle/deadline ownership, no duplicate lifecycle cache or navigation state machine.
test plan
- Parent branch alone: 102 tests passed across URL waits, Progress, and current main's function waits.
- Tests cover current URLs and fragments, same-document navigation, stale loaders, same-URL reloads, one deadline, timeout zero, and hook cleanup while setup/readiness responses are stalled.
- Extension typecheck and production build passed.
- Formatting,
git diff --check, and independent strict review passed.