fix: ShowBrowser merge behavior and consistent browser defaults
- Change ShowBrowser from bool to *bool so nil means "don't override" in mergeOptions(), fixing the bug where it always overwrote the base - Add Bool() helper for convenient *bool construction - Align NewInteractiveBrowser default from Chromium to Firefox to match NewBrowser - Update README example and CLI flags for the *bool change Closes #15, #16 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -36,6 +36,9 @@ const (
|
||||
BrowserWebKit BrowserSelection = "webkit"
|
||||
)
|
||||
|
||||
// Bool returns a pointer to the given bool value.
|
||||
func Bool(v bool) *bool { return &v }
|
||||
|
||||
type Size struct {
|
||||
Width int
|
||||
Height int
|
||||
@@ -49,7 +52,7 @@ type BrowserOptions struct {
|
||||
// browser into the cookie jar for each request.
|
||||
CookieJar
|
||||
|
||||
ShowBrowser bool // If false, browser will be headless
|
||||
ShowBrowser *bool // If nil, defaults to false (headless). Set to ptr to override.
|
||||
|
||||
Dimensions Size
|
||||
DarkMode bool
|
||||
|
||||
Reference in New Issue
Block a user