Skip to content

screenshot mask locators only masking first found item #1585

Closed

Description

@theoephraim

Environment Information

Stagehand:

  • Language/SDK: TypeScript
  • Stagehand version: 3.0.7

Issue Description

It seem that when using the mask option on page.screenshot, that only the first matching element is masked.

If this is intended behaviour, it certainly was not expected. There does not seem to be any way to explicitly opt into masking all matching elements.

Steps to Reproduce

  1. use page.screenshot with an overly broad locator (e.g., mask: page.locator('input'))
  2. call page.screenshot on a page with multiple matching elements
  3. save the screenshot to a file to observe
  4. note that only the first input is masked

Minimal Reproduction Code

I will try to set up a minimal repro and edit this soon.

Activity

  1. seanmcguire12 commented on Jan 26, 2026

    @seanmcguire12
    Member

    hey @theoephraim this is definitely a bug, thanks for flagging! working on a fix now

  2. seanmcguire12 commented on Jan 27, 2026

    @seanmcguire12
    Member

    going to close this one @theoephraim since #1612 was merged? should be available on the alpha release now

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