diff --git a/lib/PuppeteerSharp/Launcher.cs b/lib/PuppeteerSharp/Launcher.cs index 940740067..06bf0fda1 100644 --- a/lib/PuppeteerSharp/Launcher.cs +++ b/lib/PuppeteerSharp/Launcher.cs @@ -51,14 +51,19 @@ public async Task LaunchAsync(LaunchOptions options) EnsureSingleLaunchOrConnect(); _browser = options.Browser; - var buildId = options.Browser switch + + var executable = options.ExecutablePath; + if (executable == null) { - SupportedBrowser.Firefox => await Firefox.GetDefaultBuildIdAsync().ConfigureAwait(false), - SupportedBrowser.Chrome or SupportedBrowser.ChromeHeadlessShell => Chrome.DefaultBuildId, - SupportedBrowser.Chromium => await Chromium.ResolveBuildIdAsync(BrowserFetcher.GetCurrentPlatform()).ConfigureAwait(false), - _ => throw new ArgumentException("Invalid browser"), - }; - var executable = options.ExecutablePath ?? GetExecutablePath(options, buildId); + var buildId = options.Browser switch + { + SupportedBrowser.Firefox => await Firefox.GetDefaultBuildIdAsync().ConfigureAwait(false), + SupportedBrowser.Chrome or SupportedBrowser.ChromeHeadlessShell => Chrome.DefaultBuildId, + SupportedBrowser.Chromium => await Chromium.ResolveBuildIdAsync(BrowserFetcher.GetCurrentPlatform()).ConfigureAwait(false), + _ => throw new ArgumentException("Invalid browser"), + }; + executable = GetExecutablePath(options, buildId); + } Process = options.Browser switch { diff --git a/lib/PuppeteerSharp/PuppeteerSharp.csproj b/lib/PuppeteerSharp/PuppeteerSharp.csproj index a029a65ea..9f57ce6cc 100644 --- a/lib/PuppeteerSharp/PuppeteerSharp.csproj +++ b/lib/PuppeteerSharp/PuppeteerSharp.csproj @@ -12,10 +12,10 @@ Headless Browser .NET API PuppeteerSharp - 20.0.2 - 20.0.2 - 20.0.2 - 20.0.2 + 20.0.3 + 20.0.3 + 20.0.3 + 20.0.3 false false embedded