Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions browsers/profiles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -112,25 +112,25 @@ print("Live view:", kernel_browser2.browser_live_view_url)

## Loading a profile into an existing browser

You can load a profile into a browser after it has been created using the [update browser endpoint](/api-reference/browsers/update-browser-session).
You can load a profile into a browser after it has been created using the [update browser endpoint](/api-reference/browsers/update-browser-session). This supports `save_changes` as well, allowing you to persist any changes made to the hot-loaded profile when the browser is closed.

<CodeGroup>
```typescript Typescript/Javascript
// Create a browser without a profile
const kernelBrowser = await kernel.browsers.create();

// Later, load a profile into the browser
// Later, load a profile into the browser (with save_changes to persist updates)
await kernel.browsers.update(kernelBrowser.session_id, {
profile: { name: 'profiles-demo' }
profile: { name: 'profiles-demo', save_changes: true }
});
```

```python Python
# Create a browser without a profile
kernel_browser = await kernel.browsers.create()

# Later, load a profile into the browser
await kernel.browsers.update(kernel_browser.session_id, profile={"name": "profiles-demo"})
# Later, load a profile into the browser (with save_changes to persist updates)
await kernel.browsers.update(kernel_browser.session_id, profile={"name": "profiles-demo", "save_changes": True})
```
</CodeGroup>

Expand Down