Repository navigation
Conversation
The activePage() / active_page() sections demonstrate `pages()[0]`, which is the oldest tab, not the active one. Both SDKs expose the method the section is documenting, so use it.
|
|
This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run. |
Fixes #3371.
The
activePage()andactive_page()sections document the method but demonstratepages()[0], which is the oldest tab in the context — a different page whenever more than one tab is open.Both SDKs already expose what the heading promises:
packages/sdk-ts/src/browserContext.ts:46—async activePage(): Promise<Page | undefined>packages/sdk-python/src/stagehand/browser_context.py:67—async def active_page(self) -> Page | NoneSo the samples now call the method, and the return types match the
ResponseFieldalready under each sample (Page | undefined/Page | None).Docs-only change in
packages/docs/v4/reference/context.mdx; no code or API touched. I did not run the docs site build — the edit is two fenced samples inside an existing section.Summary by cubic
Fixes the
activePage()andactive_page()reference examples so they call the method they document instead ofpages()[0], which returns the oldest tab rather than the active one. Docs-only change inpackages/docs/v4/reference/context.mdxwith no code or API impact.Written for commit 07b8867. Summary will update on new commits.