Merge branch 'feat-remote-browser' into test-build

This commit is contained in:
Ronni Skansing
2026-05-21 20:48:00 +02:00
+7
View File
@@ -574,6 +574,13 @@ func (r *Runner) Run(ctx context.Context) error {
emitter.errorf(fmt.Sprintf("browser launch failed: %v", err))
return goja.Undefined()
}
// Kill and clean up Chrome when the session ends. Without this, stopping
// a run before s.close() is called leaves a zombie Chrome process (~200-300 MB).
go func() {
<-outerCtx.Done()
l.Kill()
l.Cleanup()
}()
browser = rod.New().ControlURL(u).Context(outerCtx)
if err := browser.Connect(); err != nil {
emitter.errorf(fmt.Sprintf("browser connect failed: %v", err))