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
30 changes: 30 additions & 0 deletions browsers/pools/policy-json.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,36 @@ const browser = await kernel.browsers.create({
```
</CodeGroup>

### Block DevTools and page source

DevTools hands anyone who can reach a browser a console on the page, plus network logs, cookies, and local storage. When you expose a session through live view, or run agent code you don't fully trust, block the URLs DevTools loads from:

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

kernel = Kernel()

browser = kernel.browsers.create(
chrome_policy={
"URLBlocklist": ["devtools://*", "chrome://inspect", "view-source:*"],
}
)
```

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

const kernel = new Kernel();

const browser = await kernel.browsers.create({
chrome_policy: {
URLBlocklist: ["devtools://*", "chrome://inspect", "view-source:*"],
},
});
```
</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