From cdc224e881fc69450bf50b6705057b8d839be967 Mon Sep 17 00:00:00 2001 From: 4shen0ne <4shen.01@gmail.com> Date: Wed, 31 Jul 2024 19:31:13 +0800 Subject: [PATCH] ignore default paths if -scp is provided --- pkg/engine/hybrid/hybrid.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/engine/hybrid/hybrid.go b/pkg/engine/hybrid/hybrid.go index 3e4e422b..68852bc1 100644 --- a/pkg/engine/hybrid/hybrid.go +++ b/pkg/engine/hybrid/hybrid.go @@ -137,10 +137,14 @@ func buildChromeLauncher(options *types.CrawlerOptions, dataStore string) (*laun UserDataDir(dataStore) if options.Options.UseInstalledChrome { - if chromePath, hasChrome := launcher.LookPath(); hasChrome { - chromeLauncher.Bin(chromePath) + if options.Options.SystemChromePath != "" { + chromeLauncher.Bin(options.Options.SystemChromePath) } else { - return nil, errorutil.NewWithTag("hybrid", "the chrome browser is not installed").WithLevel(errorutil.Fatal) + if chromePath, hasChrome := launcher.LookPath(); hasChrome { + chromeLauncher.Bin(chromePath) + } else { + return nil, errorutil.NewWithTag("hybrid", "the chrome browser is not installed").WithLevel(errorutil.Fatal) + } } } if options.Options.SystemChromePath != "" {