コード例 #1
0
        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);
        }
コード例 #2
0
 /// <inheritdoc />
 public Task <IBrowserContext> LaunchPersistentContextAsync(string userDataDir, LaunchOptions options)
 => LaunchPersistentContextAsync(userDataDir, options?.ToPersistentOptions() ?? new LaunchPersistentOptions());
コード例 #3
0
        /// <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()));
        }
コード例 #4
0
 /// <inheritdoc />
 public async Task <IBrowser> LaunchAsync(LaunchOptions options = null)
 => (await _channel.LaunchAsync(options).ConfigureAwait(false)).Object;
コード例 #5
0
 /// <inheritdoc cref="IBrowserType.LaunchAsync(LaunchOptions)"/>
 public abstract Task <IBrowser> LaunchAsync(LaunchOptions options = null);