Skip to content
Merged
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
66 changes: 66 additions & 0 deletions browsers/pools/policy-json.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,72 @@ The example above demonstrates setting a default homepage and managed bookmarks.
| `BookmarkBarEnabled` | `boolean` | Shows the bookmark bar |
| `ManagedBookmarks` | `array` | Pre-configured bookmarks. Supports folders via nested `children` arrays |

## Common use cases

`chrome_policy` is also accepted directly on `browsers.create()` when you don't need a reserved pool. The examples below use that path.

### Allow pop-ups

Chrome's default blocks pop-ups, which breaks sites that open download dialogs or OAuth windows in a new window. Set `DefaultPopupsSetting` to `1` to allow them (`2` blocks).

<CodeGroup>
```python Python
from kernel import Kernel

kernel = Kernel()

browser = kernel.browsers.create(
chrome_policy={
"DefaultPopupsSetting": 1,
}
)
```

```typescript Typescript/Javascript
import Kernel from '@onkernel/sdk';

const kernel = new Kernel();

const browser = await kernel.browsers.create({
chrome_policy: {
DefaultPopupsSetting: 1,
},
});
```
</CodeGroup>

### Control file download behavior

When automating file downloads that trigger permission prompts, combine `DefaultPopupsSetting: 1` with `DownloadRestrictions: 0` to allow all downloads.

<CodeGroup>
```python Python
from kernel import Kernel

kernel = Kernel()

browser = kernel.browsers.create(
chrome_policy={
"DefaultPopupsSetting": 1,
"DownloadRestrictions": 0,
}
)
```

```typescript Typescript/Javascript
import Kernel from '@onkernel/sdk';

const kernel = new Kernel();

const browser = await kernel.browsers.create({
chrome_policy: {
DefaultPopupsSetting: 1,
DownloadRestrictions: 0,
},
});
```
</CodeGroup>

## Available policies

Any policy listed in the [Chrome Enterprise policy documentation](https://chromeenterprise.google/policies/) can be used in the `chrome_policy` object. Refer to the official docs for the full list of supported policy names, types, and values.
Loading