Skip to content

fix(docs): change ref to target in browser_take_screenshot - #2130

Open
Wu Shuwen (dajiaohuang) wants to merge 1 commit into
microsoft:mainfrom
dajiaohuang:fix/42517-target-param
Open

fix(docs): change ref to target in browser_take_screenshot#2130
Wu Shuwen (dajiaohuang) wants to merge 1 commit into
microsoft:mainfrom
dajiaohuang:fix/42517-target-param

Conversation

@dajiaohuang

Copy link
Copy Markdown

Summary

Fixes #42517

The documentation for browser_take_screenshot incorrectly listed ref as the parameter for element screenshots. The actual parameter is target, as used in the implementation.

Changes

  • Changed parameter name from ref to target in the parameters table
  • Updated the example from { ref: "e12" } to { target: "e12" }

Verification

The target parameter is confirmed in the implementation at packages/playwright-core/src/tools/backend/screenshot.ts.

Fixes #42517

The documentation for browser_take_screenshot incorrectly listed 'ref' as
the parameter name for element screenshots. The actual parameter is
'target', as used in the implementation.
@EDWARD-012

Copy link
Copy Markdown

Heads-up: opened a broader docs PR that also fixes screenshots.mdx plus interaction/forms/etc.: https://github.com/microsoft/playwright.dev/pulls?q=is%3Apr+author%3AEDWARD-012

Tracking: microsoft/playwright#42539 (related to microsoft/playwright#42517). Happy for maintainers to take either your screenshots-only change or the combined PR — no hard feelings either way.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants