Skip to content

docs(context): show activePage() in its own reference examples - #3392

Open
lhy-dcf wants to merge 1 commit into
browserbase:mainfrom
lhy-dcf:docs/context-active-page
Open

lhy-dcf wants to merge 1 commit into
browserbase:mainfrom
lhy-dcf:docs/context-active-page

Conversation

@lhy-dcf

@lhy-dcf lhy-dcf commented Nov 4, 2026 •

Copy link
Copy Markdown

Fixes #3371.

The activePage() and active_page() sections document the method but demonstrate pages()[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 | None

So the samples now call the method, and the return types match the ResponseField already 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() and active_page() reference examples so they call the method they document instead of pages()[0], which returns the oldest tab rather than the active one. Docs-only change in packages/docs/v4/reference/context.mdx with no code or API impact.

Written for commit 07b8867. Summary will update on new commits.

View guided diff

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.
@lhy-dcf
lhy-dcf requested a review from a team as a code owner November 4, 2026 06:18
@changeset-bot

changeset-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 07b8867

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run.
Approving the latest commit mirrors it into an internal PR owned by the approver.
If new commits are pushed later, the internal PR stays open but is marked stale until someone approves the latest external commit and refreshes it.

@github-actions github-actions Bot added external-contributor Tracks PRs mirrored from external contributor forks. external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. labels Nov 4, 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

external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. external-contributor Tracks PRs mirrored from external contributor forks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Context activePage() docs select the oldest tab instead of the active tab

1 participant