bug: mergeOptions always overwrites ShowBrowser regardless of intent #16
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent: #3
Description
In
browser_init.go:128-158,mergeOptions()treatsShowBrowserdifferently from all other boolean fields:Unlike
RequireServerandUseLocalOnlywhich only set totrue,ShowBrowseris unconditionally overwritten. This means:BrowserOptions{ShowBrowser: true}followed byBrowserOptions{UserAgent: "custom"}, the second option resetsShowBrowsertofalseeven though it wasn't explicitly set.Fix
Either:
ShowBrowserconsistently with other booleans:if o.ShowBrowser { base.ShowBrowser = true }*boolfor all optional boolean fields to distinguish "not set" from "set to false"Starting work on this as part of PR 7 (also includes #15). Will change
ShowBrowserto*boolso nil means "don't override" inmergeOptions().Work finished. PR: #38 (merged)
Changed
ShowBrowserto*boolwithextractor.Bool()helper. Nil now means "don't override" inmergeOptions().Resolved by PR #38 —
ShowBrowserchanged to*boolinBrowserOptionssonilmeans "don't override". Browser defaults also aligned to Firefox.