Skip to main content
Browser pools accept an optional chrome_policy object that lets you apply Chrome enterprise policy settings to every browser in the pool. Use this to control startup behavior, default homepages, new tab pages, and other browser-level preferences.

Setting Chrome policies

Pass a chrome_policy object when creating a pool. The keys are Chrome policy names and the values are the corresponding policy settings.
import Kernel from '@onkernel/sdk';

const kernel = new Kernel();

const pool = await kernel.browserPools.create({
  name: "my-configured-pool",
  size: 5,
  chrome_policy: {
    HomepageIsNewTabPage: false,
    HomepageLocation: "https://kernel.sh",
    NewTabPageLocation: "https://kernel.com/docs",
    RestoreOnStartup: 4,
    RestoreOnStartupURLs: [
      "https://kernel.sh"
    ]
  }
});
You can also set chrome_policy when updating a pool. By default, idle browsers are discarded and rebuilt with the new configuration.

Example: setting a default homepage

The following configuration opens https://kernel.sh on startup, sets the Kernel docs as the new tab page, and configures the home button to navigate to https://kernel.sh:
{
  "HomepageIsNewTabPage": false,
  "HomepageLocation": "https://kernel.sh",
  "NewTabPageLocation": "https://kernel.com/docs",
  "RestoreOnStartup": 4,
  "RestoreOnStartupURLs": [
    "https://kernel.sh"
  ]
}
PolicyTypeDescription
HomepageIsNewTabPagebooleanWhen false, the home button navigates to HomepageLocation instead of the new tab page.
HomepageLocationstringURL loaded when clicking the home button.
NewTabPageLocationstringURL shown when opening a new tab.
RestoreOnStartupintegerSet to 4 to open a specific list of URLs on browser startup.
RestoreOnStartupURLsstring[]URLs to open when the browser starts. Requires RestoreOnStartup set to 4.

Available policies

Any policy listed in the Chrome Enterprise policy documentation can be passed in the chrome_policy object. Refer to the official docs for the full list of supported policy names, types, and values.