Skip to content

Add support for "isLandscape" argument for "browsingContext.setViewport" command #771

Open
@whimboo

Description

@whimboo

Both Puppeteer and Playwright support an isLandscape boolean parameter for the setViewport command, which is currently missing in WebDriver BiDi. We should add support for this parameter with the following behavior:

  • Default Behavior: By default, isLandscape is set to false, meaning the orientation will not change, even if the width is smaller than the height of the requested viewport.

  • Landscape Mode: If isLandscape is set to true, the provided dimensions will automatically swap when the width is smaller than the height (e.g., a setting of 800x1280 will result in a viewport of 1280x800).

  • Portrait Mode: To force portrait mode, isLandscape should be set to false, and the dimensions must be manually specified (e.g., 800x1280).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions