headed mode (#607)

* headed mode

* fixes

* fixes

* docs

* fixes

* fixes

* fixes
This commit is contained in:
Chris Tate
2026-03-05 11:15:17 +09:00
committed by leeguooooo
parent a71198d591
commit 7921928ec4
10 changed files with 303 additions and 71 deletions
+1 -1
View File
@@ -2135,7 +2135,7 @@ export class BrowserManager {
context = await launcher.launchPersistentContext(
path.join(os.tmpdir(), `agent-browser-ext-${session}`),
{
headless: false,
headless: options.headless ?? true,
executablePath: options.executablePath,
...(chromeChannel && { channel: chromeChannel }),
args: allArgs,
+4 -2
View File
@@ -432,7 +432,7 @@ export async function startDaemon(options?: {
} else if (manager instanceof BrowserManager) {
// Auto-launch desktop browser
const extensions = process.env.AGENT_BROWSER_EXTENSIONS
? process.env.AGENT_BROWSER_EXTENSIONS.split(',')
? process.env.AGENT_BROWSER_EXTENSIONS.split(/[,\n]/)
.map((p) => p.trim())
.filter(Boolean)
: undefined;
@@ -471,7 +471,9 @@ export async function startDaemon(options?: {
const launchOptions = {
id: 'auto',
action: 'launch' as const,
headless: process.env.AGENT_BROWSER_HEADED !== '1',
headless:
process.env.AGENT_BROWSER_HEADED !== '1' &&
process.env.AGENT_BROWSER_HEADED !== 'true',
executablePath: process.env.AGENT_BROWSER_EXECUTABLE_PATH,
extensions: extensions,
storageState: process.env.AGENT_BROWSER_STATE,