Skip to content

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

Open

Description

@vishalanton16

Summary

Docs only. activePage() / active_page() work. The samples under those headings call pages()[0], which is the oldest tab.

Repro

page2 = await browser.context.new_page("https://example.org")
await browser.context.set_active_page(page2)
pages = await browser.context.pages()
active = await browser.context.active_page()
print(await pages[0].url(), await active.url())

Live: pages()[0] was https://example.com/; active_page() was https://example.org/.

Expected

The activePage() / active_page() examples should call those methods.

Actual

packages/docs/v4/reference/context.mdx shows const [page] = await browser.context.pages(); and page = (await browser.context.pages())[0].

Possible direction: swap the samples to activePage() / active_page().

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions