feat(goto): add --wait-loaded flag for async-rendered content#69
Merged
feat(goto): add --wait-loaded flag for async-rendered content#69
Conversation
Add waitForLoaded function to browser-launcher that combines three phases: network idle + DOM stability (via existing waitForStable), loading indicator absence detection (spinners, skeletons, progress bars, aria-busy elements), and a final 300ms DOM quiet period. Wire --wait-loaded into all four goto snapshot paths, register as boolean flag, expose in macro helpers, and update help text. Closes #68
- Guard against null document.body in indicator check and MutationObserver - Limit TreeWalker to 5000 nodes to prevent DoS on huge DOMs - Use querySelectorAll with combined selectors for efficient polling - Ensure MutationObserver disconnect in all resolve paths - Parse loadedTimeout once at top of goto case (DRY) - Add tests for null guard, node limit, querySelectorAll, DRY timeout
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.
Summary
--wait-loadedflag togotocommand that waits for async-rendered content to finish loading before taking a snapshotwaitForStable), loading indicator absence (spinners, skeletons, progress bars,aria-busy), and a final DOM quiet period--timeout <ms>Changes
scripts/browser-launcher.js- NewwaitForLoadedfunction with null-body guard, querySelectorAll optimization, TreeWalker node limit, MutationObserver cleanupscripts/web-ctl.js- Flag registration, import, goto handler integration, help text, macro helperstests/web-ctl-actions.test.js- 21 new tests (export, source introspection, flag parsing, implementation, CLI integration)README.md- Action reference and common flags tablesskills/web-browse/SKILL.md- Goto section docsCHANGELOG.md- Feature entryTest Plan
npm run validatepassesgoto https://example.com --wait-loadedreturnswaitLoaded: true--timeout,--ensure-auth, snapshot flagsCloses #68