From 8595de88243aa13c40be296bb098c4f75eac2dcd Mon Sep 17 00:00:00 2001 From: Ed Salkeld Date: Mon, 23 Feb 2026 17:33:13 +0000 Subject: [PATCH 1/2] Add --fake-media flag to prevent crashes on pages that request microphone/camera Passes --use-fake-device-for-media-stream and --use-fake-ui-for-media-stream to Chrome, which provides synthetic media streams instead of prompting for real device access. Without this, headless Chrome crashes when a page calls getUserMedia(). --- main.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 0b2531a..be209db 100644 --- a/main.go +++ b/main.go @@ -320,12 +320,15 @@ func withPage() (*State, *rod.Browser, *rod.Page) { func cmdStart(args []string) { ignoreCertErrors := false + fakeMedia := false for i := 0; i < len(args); i++ { switch args[i] { case "--insecure", "-k": ignoreCertErrors = true + case "--fake-media": + fakeMedia = true default: - fatal("unknown flag: %s\nusage: rodney start [--insecure]", args[i]) + fatal("unknown flag: %s\nusage: rodney start [--insecure] [--fake-media]", args[i]) } } @@ -405,6 +408,11 @@ func cmdStart(args []string) { l.Set("ignore-certificate-errors") } + if fakeMedia { + l.Set("use-fake-device-for-media-stream") + l.Set("use-fake-ui-for-media-stream") + } + debugURL := l.MustLaunch() // Get Chrome PID from the launcher From 072bd70767a0595c3f8dee5e3e4117c88dea8b3b Mon Sep 17 00:00:00 2001 From: Ed Salkeld Date: Tue, 24 Feb 2026 09:56:02 +0000 Subject: [PATCH 2/2] Document --fake-media flag in README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3cb2e26..36b1f09 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ Requires: rodney start # Launch headless Chrome rodney start --show # Launch with visible browser window rodney start --insecure # Launch with TLS errors ignored (-k shorthand) +rodney start --fake-media # Launch with fake media devices (avoids getUserMedia crashes) rodney connect host:9222 # Connect to existing Chrome on remote debug port rodney status # Show browser info and active page rodney stop # Shut down Chrome @@ -403,7 +404,7 @@ The tool uses the [rod](https://github.com/go-rod/rod) Go library which communic | Command | Arguments | Description | |---|---|---| -| `start` | `[--show] [--insecure\|-k]` | Launch Chrome (headless by default, `--show` for visible) | +| `start` | `[--show] [--insecure\|-k] [--fake-media]` | Launch Chrome (headless by default, `--show` for visible) | | `connect` | `` | Connect to existing Chrome on remote debug port | | `stop` | | Shut down Chrome | | `status` | | Show browser status |