Skip to content

Commit 68eae49

Browse files
committed
Document start_url with profiles
1 parent 4e37b33 commit 68eae49

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

auth/profiles.mdx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,28 @@ print("Live view:", kernel_browser2.browser_live_view_url)
112112
```
113113
</CodeGroup>
114114

115+
## Override opening existing tabs in a new session
116+
117+
Profiles can restore tabs saved in the profile. Pass `start_url` with the profile to clear those restored tabs and open a specific page when the new browser starts.
118+
119+
<CodeGroup>
120+
```typescript Typescript/Javascript
121+
const browser = await kernel.browsers.create({
122+
profile: { name: 'profiles-demo' },
123+
start_url: 'https://example.com/dashboard',
124+
});
125+
```
126+
127+
```python Python
128+
browser = await kernel.browsers.create(
129+
profile={"name": "profiles-demo"},
130+
start_url="https://example.com/dashboard",
131+
)
132+
```
133+
</CodeGroup>
134+
135+
The same behavior applies to browser pools configured with both a profile and start url.
136+
115137
## Loading a profile into an existing browser
116138

117139
You can load a profile into a browser after it has been created using the [update browser endpoint](https://kernel.sh/docs/api-reference/browsers/update-browser-session).

0 commit comments

Comments
 (0)