Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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` | `<host:port>` | Connect to existing Chrome on remote debug port |
| `stop` | | Shut down Chrome |
| `status` | | Show browser status |
Expand Down
10 changes: 9 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}
}

Expand Down Expand Up @@ -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
Expand Down