You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: browsers/pools/policy-json.mdx
+66Lines changed: 66 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,6 +174,72 @@ The example above demonstrates setting a default homepage and managed bookmarks.
174
174
|`BookmarkBarEnabled`|`boolean`| Shows the bookmark bar |
175
175
|`ManagedBookmarks`|`array`| Pre-configured bookmarks. Supports folders via nested `children` arrays |
176
176
177
+
## Common use cases
178
+
179
+
`chrome_policy` is also accepted directly on `browsers.create()` when you don't need a reserved pool. The examples below use that path.
180
+
181
+
### Allow pop-ups
182
+
183
+
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).
184
+
185
+
<CodeGroup>
186
+
```python Python
187
+
from kernel import Kernel
188
+
189
+
kernel = Kernel()
190
+
191
+
browser = kernel.browsers.create(
192
+
chrome_policy={
193
+
"DefaultPopupsSetting": 1,
194
+
}
195
+
)
196
+
```
197
+
198
+
```typescript Typescript/Javascript
199
+
importKernelfrom'@onkernel/sdk';
200
+
201
+
const kernel =newKernel();
202
+
203
+
const browser =awaitkernel.browsers.create({
204
+
chrome_policy: {
205
+
DefaultPopupsSetting: 1,
206
+
},
207
+
});
208
+
```
209
+
</CodeGroup>
210
+
211
+
### Control file download behavior
212
+
213
+
When automating file downloads that trigger permission prompts, combine `DefaultPopupsSetting: 1` with `DownloadRestrictions: 0` to allow all downloads.
214
+
215
+
<CodeGroup>
216
+
```python Python
217
+
from kernel import Kernel
218
+
219
+
kernel = Kernel()
220
+
221
+
browser = kernel.browsers.create(
222
+
chrome_policy={
223
+
"DefaultPopupsSetting": 1,
224
+
"DownloadRestrictions": 0,
225
+
}
226
+
)
227
+
```
228
+
229
+
```typescript Typescript/Javascript
230
+
importKernelfrom'@onkernel/sdk';
231
+
232
+
const kernel =newKernel();
233
+
234
+
const browser =awaitkernel.browsers.create({
235
+
chrome_policy: {
236
+
DefaultPopupsSetting: 1,
237
+
DownloadRestrictions: 0,
238
+
},
239
+
});
240
+
```
241
+
</CodeGroup>
242
+
177
243
## Available policies
178
244
179
245
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.
0 commit comments