Skip to content

Commit eb15530

Browse files
authored
Merge pull request #2 from saffron-health/merge-remote
Merge remote
2 parents 7be1a57 + 2177af2 commit eb15530

35 files changed

+543
-238
lines changed

.changeset/bumpy-mugs-sneeze.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/cold-pumas-accept.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/fresh-papayas-beam.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/hot-geckos-build.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/proud-weeks-cover.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/rich-bobcats-sneeze.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/slow-dryers-repeat.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
# @browserbasehq/stagehand
22

3+
## 2.4.2
4+
5+
### Patch Changes
6+
7+
- [#865](https://github.com/browserbase/stagehand/pull/865) [`6b4e6e3`](https://github.com/browserbase/stagehand/commit/6b4e6e3f31d5496cf15728e9018eddeb04839542) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - improve type safety for trimTrailingTextNode
8+
9+
- [#897](https://github.com/browserbase/stagehand/pull/897) [`e77d018`](https://github.com/browserbase/stagehand/commit/e77d0188683ebf596dfb78dfafbbca1dc32993f0) Thanks [@miguelg719](https://github.com/miguelg719)! - Fix selfHeal to remember intially received arguments
10+
11+
- [#920](https://github.com/browserbase/stagehand/pull/920) [`c20adb9`](https://github.com/browserbase/stagehand/commit/c20adb95539fed8c56a4aa413262a9c65a8e6474) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - fix: tab handling on API
12+
13+
- [#882](https://github.com/browserbase/stagehand/pull/882) [`b86df93`](https://github.com/browserbase/stagehand/commit/b86df93b9136aae96292121a29c25f3d74d84bf7) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - remove elements that don't have xpaths from observe response
14+
15+
- [#905](https://github.com/browserbase/stagehand/pull/905) [`023c2c2`](https://github.com/browserbase/stagehand/commit/023c2c273b46d3792d7e5d3c902089487b16b531) Thanks [@tkattkat](https://github.com/tkattkat)! - Delete old images from anthropic cua client
16+
17+
- [#925](https://github.com/browserbase/stagehand/pull/925) [`8c28647`](https://github.com/browserbase/stagehand/commit/8c2864755ecd05c8f7de235d4198deec0dd5f78e) Thanks [@miguelg719](https://github.com/miguelg719)! - Remove \_refreshPageFromApi()
18+
19+
- [#887](https://github.com/browserbase/stagehand/pull/887) [`87e09c6`](https://github.com/browserbase/stagehand/commit/87e09c618940f364ec8af00455a19a17ec63cbd3) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - fix: allow xpaths with prepended 'xpath=' for targeted extract
20+
21+
- [#864](https://github.com/browserbase/stagehand/pull/864) [`a611115`](https://github.com/browserbase/stagehand/commit/a61111525d70b450bdfc43f112380f44899c9e97) Thanks [@miguelg719](https://github.com/miguelg719)! - Temporarily patch custom clients serialization error on api
22+
23+
- [#881](https://github.com/browserbase/stagehand/pull/881) [`69913fe`](https://github.com/browserbase/stagehand/commit/69913fe1dfb8201ae2aeffa5f049fb46ab02cbc2) Thanks [@miguelg719](https://github.com/miguelg719)! - Pass sdk version number to API for debugging
24+
25+
- [#913](https://github.com/browserbase/stagehand/pull/913) [`b1b83a1`](https://github.com/browserbase/stagehand/commit/b1b83a1d334fe76e5f5f9dd32dc92c16b7d40ce6) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - move iframe out of 'experimental'
26+
27+
- [#891](https://github.com/browserbase/stagehand/pull/891) [`be8497c`](https://github.com/browserbase/stagehand/commit/be8497cb6b142cc893cea9692b8c47bd19514c60) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - fix: nested iframe xpath bug
28+
29+
- [#883](https://github.com/browserbase/stagehand/pull/883) [`98704c9`](https://github.com/browserbase/stagehand/commit/98704c9ed225ca25bbde4bb3dc286936e9c54471) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add timeout for JS click
30+
31+
- [#907](https://github.com/browserbase/stagehand/pull/907) [`04978bd`](https://github.com/browserbase/stagehand/commit/04978bdd30d2edcbc69eb9fd91358a16975ea2eb) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - store mapping of CDP frame ID -> page
32+
333
## 2.4.1
434

535
### Patch Changes

docs/docs.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@
101101
}
102102
},
103103
"integrations": {
104-
"koala": {
105-
"publicApiKey": "pk_6e508a479e95d94298f034e98ec54590ccf4"
104+
"posthog": {
105+
"apiKey": "phc_hmwkFrlc9UVrdE1jyG8AEKoCQCSr8dScjsRpKoLBEiV",
106+
"apiHost": "https://us.i.posthog.com"
106107
}
107108
}
108109
}

docs/examples/best_practices.mdx

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,59 @@ For Stagehand's Cursor rules, check out [this file](https://github.com/browserba
1111

1212
If you're using Windsurf, you can use the same rules by adding them to your `.windsurfrules` file.
1313

14+
### Manage multiple pages explicitly (Stagehand v≥ 2.4.1, TypeScript)
15+
<Tabs>
16+
<Tab title="TypeScript">
17+
Stagehand can now keep **multiple pages open at the same time** and run
18+
`act()`, `observe()` and `extract()` on each of them.
19+
20+
#### What changed?
21+
22+
* **Before v2.4.1** Stagehand silently closed every new tab and re‑used the first tab.
23+
A single Page instance (`stagehand.page`) was always valid.
24+
* **Since v2.4.1** New tabs stay open. You can switch between them or operate on all of them in parallel.
25+
26+
#### The live‑page proxy (`stagehand.page`)
27+
28+
For backward compatibility, `stagehand.page` is now a **live proxy** that always
29+
points to the **most recently opened page**.
30+
We recommend using it for things like agents, which often don't have the ability to operate on multiple pages.
31+
If you need more control and precision, we recommend managing pages yourself.
32+
33+
#### Recommended workflow
34+
<CodeGroup>
35+
```typescript TypeScript
36+
// Create (or let the site create) additional pages.
37+
await stagehand.context.newPage(); // e.g. open a blank page
38+
const pages = stagehand.context.pages();
39+
40+
const [page1, page2] = pages;
41+
42+
// Work on each page deterministically
43+
await page1.goto('https://github.com/browserbase/stagehand');
44+
await page2.goto('https://github.com/browserbase/stagehand-python');
45+
46+
const [{ extraction: repo1 }, { extraction: repo2 }] = await Promise.all([
47+
page1.extract('extract the repository name'),
48+
page2.extract('extract the repository name'),
49+
]);
50+
51+
// should log "page1 repo: stagehand"
52+
console.log(`page1 repo: ${repo1}`);
53+
54+
// should log "page2 repo: stagehand-python"
55+
console.log(`page2 repo: ${repo2}`);
56+
```
57+
</CodeGroup>
58+
</Tab>
59+
<Tab title="Python">
60+
<Tip>
61+
Multi tab support is not yet implemented in Python, but it's coming soon!
62+
Setting `use_api=True` in your stagehand config will keep tabs open.
63+
</Tip>
64+
</Tab>
65+
</Tabs>
66+
1467
### Avoid sending sensitive information to LLMs
1568

1669
You can use `variables` in an `act` call to avoid sending sensitive information to LLMs.

0 commit comments

Comments
 (0)