diff --git a/runner/headless.go b/runner/headless.go index f868e08..40b81eb 100644 --- a/runner/headless.go +++ b/runner/headless.go @@ -11,7 +11,6 @@ import ( "github.com/pkg/errors" fileutil "github.com/projectdiscovery/utils/file" osutils "github.com/projectdiscovery/utils/os" - processutil "github.com/projectdiscovery/utils/process" ) // MustDisableSandbox determines if the current os and user needs sandbox mode disabled @@ -24,7 +23,10 @@ func MustDisableSandbox() bool { type Browser struct { tempDir string engine *rod.Browser - pids map[int32]struct{} + // TODO: Remove the Chrome PID kill code in favor of using Leakless(true). + // This change will be made if there are no complaints about zombie Chrome processes. + // Reference: https://github.com/projectdiscovery/httpx/pull/1426 + // pids map[int32]struct{} } func NewBrowser(proxy string, useLocal bool) (*Browser, error) { @@ -33,10 +35,10 @@ func NewBrowser(proxy string, useLocal bool) (*Browser, error) { return nil, errors.Wrap(err, "could not create temporary directory") } - pids := processutil.FindProcesses(processutil.IsChromeProcess) + // pids := processutil.FindProcesses(processutil.IsChromeProcess) chromeLauncher := launcher.New(). - Leakless(false). + Leakless(true). Set("disable-gpu", "true"). Set("ignore-certificate-errors", "true"). Set("ignore-certificate-errors", "1"). @@ -85,7 +87,7 @@ func NewBrowser(proxy string, useLocal bool) (*Browser, error) { engine := &Browser{ tempDir: dataStore, engine: browser, - pids: pids, + // pids: pids, } return engine, nil } @@ -125,5 +127,5 @@ func (b *Browser) ScreenshotWithBody(url string, timeout time.Duration) ([]byte, func (b *Browser) Close() { b.engine.Close() os.RemoveAll(b.tempDir) - processutil.CloseProcesses(processutil.IsChromeProcess, b.pids) + // processutil.CloseProcesses(processutil.IsChromeProcess, b.pids) }