feat: add browser configuration tool and fix STDIO mode

- Add browser_configure tool to change headless/headed mode, viewport, and user agent during session
- Fix STDIO entry point by preventing stdin close handlers in STDIO mode
- Fix headed mode default behavior when DISPLAY is available on Linux
- Add dynamic browser configuration update mechanism in Context class

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ryan Malloy 2025-08-11 03:39:24 -06:00
parent e846cd509c
commit aa84278d36
5 changed files with 235 additions and 12 deletions

View file

@ -129,8 +129,10 @@ export function configFromCLIOptions(cliOptions: CLIOptions): Config {
const launchOptions: LaunchOptions = {
channel,
executablePath: cliOptions.executablePath,
headless: cliOptions.headless,
};
if (cliOptions.headless !== undefined) {
launchOptions.headless = cliOptions.headless;
}
// --no-sandbox was passed, disable the sandbox
if (cliOptions.sandbox === false)