From 36ee049855dc4f874330943ebf261dd76acd4c64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fan=20Can=20Bak=C4=B1r?= Date: Mon, 14 Oct 2024 16:13:42 +0300 Subject: [PATCH] disable sandbox on CI --- pkg/protocols/headless/engine/engine.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/protocols/headless/engine/engine.go b/pkg/protocols/headless/engine/engine.go index 04d6b2a655..581472a0dd 100644 --- a/pkg/protocols/headless/engine/engine.go +++ b/pkg/protocols/headless/engine/engine.go @@ -9,6 +9,7 @@ import ( "github.com/go-rod/rod" "github.com/go-rod/rod/lib/launcher" "github.com/go-rod/rod/lib/launcher/flags" + "github.com/kitabisa/go-ci" "github.com/pkg/errors" "github.com/projectdiscovery/nuclei/v3/pkg/types" @@ -121,7 +122,7 @@ func New(options *types.Options) (*Browser, error) { func MustDisableSandbox() bool { // linux with root user needs "--no-sandbox" option // https://github.com/chromium/chromium/blob/c4d3c31083a2e1481253ff2d24298a1dfe19c754/chrome/test/chromedriver/client/chromedriver.py#L209 - return osutils.IsLinux() && os.Geteuid() == 0 + return (osutils.IsLinux() && os.Geteuid() == 0) || ci.IsCI() } // SetUserAgent sets custom user agent to the browser