Skip to content

Conversation

miguelg719
Copy link
Collaborator

why

The new version of Stagehand API supports iframes, but the python sdk doesn't directly support them

what changed

Enabled access to setting iframes:True whenever the environment is "BROWSERBASE" (with api enabled)

test plan

@miguelg719 miguelg719 marked this pull request as ready for review July 25, 2025 00:37
payload = ObserveResult(**action_or_result).model_dump(
exclude_none=True, by_alias=True
)
if "description" in action_or_result:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this related to the PR? seems like Claude Code / Cursor added unless intentional to have actFromObserve distinction when sending the payload to the API?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added, it's so that people can pass sth like

await page.act({
  "action": "click the button"
  "iframes": True
})

Previously it was only parsing the dict as an observe result

await page.act({
   "description": "A brief description of the component",
   "method": 'click',
   "arguments": [],
   "selector": 'xpath=/html/body[1]/div[1]/main[1]/button[1]'
})

Makes it easy to copy-paste code from TS directly

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome!

@miguelg719 miguelg719 merged commit 76669f0 into main Jul 28, 2025
12 checks passed
@github-actions github-actions bot mentioned this pull request Jul 28, 2025
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.

3 participants