Skip to content

[Feature]: API for window.history.go() #34028

@leotg130

Description

@leotg130

🚀 Feature Request

Currently Playwright supports both page.goBack() and page.goForward(), but seems to lack the other option that window.history.go() supports, which is multiple history navigations in one go.

Not sure if it even makes sense to keep both the goBack()/goForward(), or if there should be just .go(delta: number, options: {...}).

Might also make sense to expose the entire history API, and if possible more extensively than is allowed by JS on a page, which doesn't have access to the URL's, etc. Though I'm not sure how Playwright instruments the browser, so it might not have any more access than JS on page does.

Example

No response

Motivation

Allows to better simulate user behavior where user navigates multiple history pages.

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