diff --git a/backend/remotebrowser/runner.go b/backend/remotebrowser/runner.go index 611e504..d64cad4 100644 --- a/backend/remotebrowser/runner.go +++ b/backend/remotebrowser/runner.go @@ -1,7 +1,6 @@ package remotebrowser import ( - "bytes" "context" "encoding/json" "errors" @@ -96,29 +95,6 @@ func resolveBrowserRootDir() (string, error) { return filepath.Join(filepath.Dir(execPath), "data", "browser"), nil } -// chromeSterrWriter is an io.Writer that forwards Chrome stdout/stderr lines to -// the session emitter so crash messages appear in the operator event log. -type chromeSterrWriter struct { - emitter *channelEmitter - buf []byte -} - -func (w *chromeSterrWriter) Write(p []byte) (int, error) { - w.buf = append(w.buf, p...) - for { - idx := bytes.IndexByte(w.buf, '\n') - if idx < 0 { - break - } - line := strings.TrimSpace(string(w.buf[:idx])) - w.buf = w.buf[idx+1:] - if line != "" { - w.emitter.log("[chrome] " + line) - } - } - return len(p), nil -} - // scriptStopError is thrown by stop() for a clean script exit with no error emitted. type scriptStopError struct{} @@ -508,10 +484,8 @@ func (r *Runner) Run(ctx context.Context) error { os.MkdirAll(filepath.Join(rootDir, "config"), 0755) //nolint:errcheck os.MkdirAll(filepath.Join(rootDir, "cache"), 0755) //nolint:errcheck - chromeLog := &chromeSterrWriter{emitter: emitter} l := launcher.New(). Headless(opts.Headless). - Logger(chromeLog). Set("disable-crash-reporter"). Set("crash-dumps-dir", crashDir). // Prevents navigator.webdriver from being set to true, which is @@ -523,7 +497,6 @@ func (r *Runner) Run(ctx context.Context) error { )...) if r.ExecPath != "" { - emitter.log(fmt.Sprintf("[session] using browser: %s", r.ExecPath)) l = l.Bin(r.ExecPath) } else { b := launcher.NewBrowser() @@ -535,7 +508,6 @@ func (r *Runner) Run(ctx context.Context) error { return goja.Undefined() } } - emitter.log(fmt.Sprintf("[session] using browser: %s", binPath)) l = l.Bin(binPath) } if opts.Proxy != "" {