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
32 changes: 32 additions & 0 deletions browsers/chrome-policies.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,38 @@ const browser = await kernel.browsers.create({
```
</CodeGroup>

### Restrict navigation to specific URLs

To lock a browser to an approved set of URLs, block everything with `URLBlocklist` and then allow back only the URLs you want with `URLAllowlist`. Entries match a whole domain (`chatgpt.com`) or a specific path (`en.wikipedia.org/wiki/Cat`), and more specific entries take precedence. This gates top-level navigation, so any other URL returns `ERR_BLOCKED_BY_ADMINISTRATOR`; it does not block resources or API calls a permitted page loads from other origins.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dense intro needs bullet list

Low Severity

The new “Restrict navigation” intro packs several separable points—block-all plus allowlist, domain vs path-style entries, precedence, top-level ERR_BLOCKED_BY_ADMINISTRATOR, and sub-resource exceptions—into one dense paragraph instead of a lead-in plus bullets per documentation style rules.

Fix in Cursor Fix in Web

Triggered by learned rule: Use bullet lists when covering multiple distinct points in guides

Reviewed by Cursor Bugbot for commit ccb1161. Configure here.


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

kernel = Kernel()

browser = kernel.browsers.create(
chrome_policy={
"URLBlocklist": ["*"],
"URLAllowlist": ["chatgpt.com", "en.wikipedia.org/wiki/Cat"],
}
)
```

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

const kernel = new Kernel();

const browser = await kernel.browsers.create({
chrome_policy: {
URLBlocklist: ["*"],
URLAllowlist: ["chatgpt.com", "en.wikipedia.org/wiki/Cat"],
},
});
```
</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