internal string GetBrowserExecutablePath(LaunchOptions options) { string browserExecutable = options.ExecutablePath; if (string.IsNullOrEmpty(browserExecutable)) { browserExecutable = ResolveExecutablePath(); } if (!File.Exists(browserExecutable)) { throw new FileNotFoundException($"Failed to launch {Name}! path to executable does not exist", browserExecutable); } return(browserExecutable); }
/// <inheritdoc /> public Task <IBrowserContext> LaunchPersistentContextAsync(string userDataDir, LaunchOptions options) => LaunchPersistentContextAsync(userDataDir, options?.ToPersistentOptions() ?? new LaunchPersistentOptions());
/// <inheritdoc /> public Task <IBrowserContext> LaunchPersistentContextAsync(string userDataDir, LaunchOptions options) { if (options?.FirefoxUserPrefs != null) { throw new ArgumentException($"{nameof(LaunchOptions.FirefoxUserPrefs)} option is not supported in LaunchPersistentContextAsync."); } return(LaunchPersistentContextAsync(userDataDir, options?.ToPersistentOptions() ?? new LaunchPersistentOptions())); }
/// <inheritdoc /> public async Task <IBrowser> LaunchAsync(LaunchOptions options = null) => (await _channel.LaunchAsync(options).ConfigureAwait(false)).Object;
/// <inheritdoc cref="IBrowserType.LaunchAsync(LaunchOptions)"/> public abstract Task <IBrowser> LaunchAsync(LaunchOptions options = null);