Skip to content

docs: clarify browser navigation hook lifecycle - #4569

Draft
NginxL wants to merge 1 commit into
apify:masterfrom
NginxL:docs/navigation-hook-lifecycle
Draft

NginxL wants to merge 1 commit into
apify:masterfrom
NginxL:docs/navigation-hook-lifecycle

Conversation

@NginxL

@NginxL NginxL commented Dec 5, 2026

Copy link
Copy Markdown

Summary

Clarify the browser navigation hook lifecycle:

  • preNavigationHooks run after page creation and before navigation, when the page is typically still at about:blank.
  • postNavigationHooks run after navigation and before requestHandler (formerly handlePageFunction).
  • Correct the context-order note: page is already available in pre-navigation hooks, while response becomes available after navigation.
  • Align the Playwright and Puppeteer API comments with the base browser crawler.

Fixes #1213.

Validation

  • git diff --check passed.
  • Cross-checked the documented order against BrowserCrawler#buildContextPipeline, #preparePage, the pre-navigation hook loop, navigate, and the post-navigation hook loop.
  • Documentation/comment-only change; no runtime code or public type signatures changed.

Gaps

  • The full test, lint, formatting, and API-report checks were not run because dependencies are not installed in this environment and installing them is outside the task constraints.

AI disclosure

This documentation change was prepared with AI assistance and reviewed against the current implementation before submission.

@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Dec 5, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

adding more information about the cycle of postNavigationHooks and preNavigationHooks

1 participant