Return simple getter results directly - #2436
Open
monadoid wants to merge 1 commit into
Open
Conversation
|
monadoid
marked this pull request as ready for review
July 28, 2026 11:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR removes some unnecessary objects and simplifies them to just their values - where it makes sense to and we won't need to extend them later.
Previously, the TypeScript SDK received an object from the protocol and unwrapped its single field:
Now the protocol returns the value directly, so the SDK can return it without unwrapping:
The user facing SDKs remain the identical before and after:
page.url:{ url: string }→stringpage.title:{ title: string }→stringlocator.count:{ count: number }→numberlocator.is_checked:{ checked: boolean }→booleanlocator.is_visible:{ visible: boolean }→booleanlocator.input_value:{ value: string }→stringlocator.inner_text:{ text: string }→stringlocator.inner_html:{ html: string }→stringlocator.text_content:{ textContent: string }→stringlocator.select_option:{ values: string[] }→string[]context.clipboard_read_text:{ text: string }→stringreadTextis deliberately text-specific. Rich clipboard data would require a broader clipboard method.context.cookies:{ cookies: Cookie[] }→Cookie[]Cookie; pagination is not currently needed.context.get_domain_policy:{ policy: DomainPolicy | null }→DomainPolicy | nullDomainPolicy. Configured and effective policies could be separate APIs if that distinction is needed.page.wait_for_selectoris intentionally unchanged because its result semantics need a separate decision. Coordinate operation results also remain structured objects.