Skip to content

Enable access to iframes on api #167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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!

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