import{_ as e,o,c as r,ag as a}from"./chunks/framework.CAXxHpAX.js";const p=JSON.parse('{"title":"Browser Contexts","description":"","frontmatter":{},"headers":[],"relativePath":"getting-started/browser.md","filePath":"getting-started/browser.md","lastUpdated":1774787421000}'),s={name:"getting-started/browser.md"};function i(n,t,l,d,c,h){return o(),r("div",null,[...t[0]||(t[0]=[a('
Memoh can give a bot access to a headless browser through the Browser Gateway. A Browser Context stores the browser environment a bot should use, such as viewport size, locale, timezone, and mobile behavior.
Once a browser context is assigned to a bot, the bot can use browser tools to open pages, click elements, fill forms, capture screenshots, and inspect page content.
The Browser Gateway is powered by Playwright and provides browser automation for bots. In practice, a browser context acts like a reusable browser profile configuration for one or more bots.
Typical use cases include:
Manage contexts from the Browser Contexts page in the sidebar.
After creating a context, select it from the sidebar and update its settings.
| Field | Description |
|---|---|
| Name | The display name shown in the UI. |
| Core | Browser engine: chromium (default) or firefox. |
| Viewport Width | Browser viewport width in pixels. |
| Viewport Height | Browser viewport height in pixels. |
| User Agent | Optional custom browser user agent string. |
| Device Scale Factor | Optional device pixel ratio. |
| Locale | Optional locale such as en-US or zh-CN. |
| Timezone ID | Optional timezone such as UTC or Asia/Shanghai. |
| Is Mobile | Enables mobile-style browser behavior. |
| Ignore HTTPS Errors | Allows navigation to sites with invalid HTTPS certificates. |
After saving, the bot can use that browser context when browser tools are invoked.
When a browser context is configured, the bot can use built-in browser tools such as:
browser_action: perform actions like navigation, click, fill, select, scroll, tab management, screenshot, or PDF exportbrowser_observe: inspect the current page and gather information for the modelThis lets the bot interact with real websites instead of relying only on static HTML or search results.
Memoh's browser image can include Chromium, Firefox, or both. The available cores are determined at build time by the BROWSER_CORES build argument.
The install script prompts for browser core selection during setup. To rebuild manually with specific cores:
BROWSER_CORES=chromium docker compose --profile browser build browserValid values for BROWSER_CORES: chromium, firefox, chromium,firefox (default).