diff --git a/browsers/pools/policy-json.mdx b/browsers/pools/policy-json.mdx index 3957b32..1332c80 100644 --- a/browsers/pools/policy-json.mdx +++ b/browsers/pools/policy-json.mdx @@ -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). + + +```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, + }, +}); +``` + + +### Control file download behavior + +When automating file downloads that trigger permission prompts, combine `DefaultPopupsSetting: 1` with `DownloadRestrictions: 0` to allow all downloads. + + +```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, + }, +}); +``` + + ## 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.