Skip to content
Open
Show file tree
Hide file tree
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
22 changes: 22 additions & 0 deletions auth/profiles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,28 @@ print("Live view:", kernel_browser2.browser_live_view_url)
```
</CodeGroup>

## Override opening existing tabs in a new session

Profiles can restore tabs saved in the profile. Pass `start_url` with the profile to open a specific page instead when the new browser starts.

<CodeGroup>
```typescript Typescript/Javascript
const browser = await kernel.browsers.create({
profile: { name: 'profiles-demo' },
start_url: 'https://example.com/dashboard',
});
```

```python Python
browser = await kernel.browsers.create(
profile={"name": "profiles-demo"},
start_url="https://example.com/dashboard",
)
```
</CodeGroup>

The same behavior applies to browser pools configured with both a profile and start 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](https://kernel.sh/docs/api-reference/browsers/update-browser-session).
Expand Down
4 changes: 3 additions & 1 deletion browsers/pools/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const pool = await kernel.browserPools.create({
stealth: true,
headless: false,
timeout_seconds: 600,
start_url: "https://example.com",
viewport: {
width: 1280,
height: 800
Expand All @@ -72,6 +73,7 @@ pool = kernel.browser_pools.create(
stealth=True,
headless=False,
timeout_seconds=600,
start_url="https://example.com",
viewport={
"width": 1280,
"height": 800
Expand All @@ -84,7 +86,7 @@ print(pool.id)

### Pool configuration options

Pools can be pre-configured with options like custom extensions, supported viewports, residential proxies, profiles, and more. See the [API reference](https://kernel.sh/docs/api-reference/browser-pools/create-a-browser-pool) for more details.
Pools can be pre-configured with options like start url, custom extensions, supported viewports, residential proxies, profiles, and more. See the [API reference](https://kernel.sh/docs/api-reference/browser-pools/create-a-browser-pool) for more details.

## Acquire a browser

Expand Down
4 changes: 4 additions & 0 deletions reference/cli/browsers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Create a new browser session.
| `--stealth` | Enable stealth mode to reduce automation fingerprints. |
| `--headless` | Launch without GUI/VNC access. |
| `--kiosk` | Launch in Chrome kiosk mode. |
| `--start-url <url>` | Initial page to open on launch. |
| `--output json`, `-o json` | Output raw JSON object. |

### `kernel browsers delete <session-id>`
Expand Down Expand Up @@ -432,6 +433,7 @@ Create a new browser pool.
| `--size <n>` | Number of browsers in the pool (required). |
| `--fill-rate <n>` | Percentage of the pool to fill per minute. |
| `--timeout <seconds>` | Idle timeout for browsers acquired from the pool. |
| `--start-url <url>` | Initial page to open for new browsers. |
| `--output json`, `-o json` | Output raw JSON object. |

### `kernel browser-pools get <id-or-name>`
Expand All @@ -447,6 +449,8 @@ Update pool configuration.
| Flag | Description |
|------|-------------|
| `--size <n>` | Updated pool size. |
| `--start-url <url>` | Initial page to open for new browsers. |
| `--clear-start-url` | Clear the pool start URL. |
| `--discard-all-idle` | Discard all idle browsers and refill. |
| `--output json`, `-o json` | Output raw JSON object. |

Expand Down
Loading