fix: pass user data dir to WXT when using dev:watch --new (#403)

The --new flag creates a fresh temp profile directory but WXT's
chromiumProfile was hardcoded to /tmp/browseros-dev, ignoring it.
Pass BROWSEROS_USER_DATA_DIR env var from the Go dev tool and read
it in web-ext.config.ts.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Nikhil
2026-03-04 10:58:43 -08:00
committed by GitHub
parent 92c20eef73
commit acb7dfc624
2 changed files with 2 additions and 1 deletions

View File

@@ -40,7 +40,7 @@ export default defineWebExtConfig({
'/Applications/BrowserOS.app/Contents/MacOS/BrowserOS',
},
chromiumArgs,
chromiumProfile: '/tmp/browseros-dev',
chromiumProfile: env.BROWSEROS_USER_DATA_DIR || '/tmp/browseros-dev',
keepProfileChanges: true,
startUrls: ['chrome://newtab'],
})

View File

@@ -74,6 +74,7 @@ func runWatch(cmd *cobra.Command, args []string) error {
fmt.Println()
env := proc.BuildEnv(p, "development")
env = append(env, fmt.Sprintf("BROWSEROS_USER_DATA_DIR=%s", userDataDir))
ctx, cancel := context.WithCancel(context.Background())
defer cancel()