Skip to content

Commit 43bd252

Browse files
authored
Always add about:blank to default arguments. (#611)
1 parent c18b68e commit 43bd252

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lib/PuppeteerSharp/ChromiumProcess.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ public class ChromiumProcess : IDisposable
7777
public ChromiumProcess(string chromiumExecutable, LaunchOptions options, ILoggerFactory loggerFactory)
7878
{
7979
_options = options;
80-
_logger = options.LogProcess
81-
? loggerFactory.CreateLogger<ChromiumProcess>()
80+
_logger = options.LogProcess
81+
? loggerFactory.CreateLogger<ChromiumProcess>()
8282
: null;
8383

8484
List<string> chromiumArgs;
@@ -138,8 +138,8 @@ public void Dispose()
138138
/// <summary>
139139
/// Gets Chromium endpoint.
140140
/// </summary>
141-
public string EndPoint => _startCompletionSource.Task.IsCompleted
142-
? _startCompletionSource.Task.Result
141+
public string EndPoint => _startCompletionSource.Task.IsCompleted
142+
? _startCompletionSource.Task.Result
143143
: null;
144144

145145
/// <summary>
@@ -168,8 +168,8 @@ public void Dispose()
168168
/// </summary>
169169
/// <param name="timeout">The maximum waiting time for a graceful process exit.</param>
170170
/// <returns></returns>
171-
public Task EnsureExitAsync(TimeSpan? timeout) => timeout.HasValue
172-
? _currentState.ExitAsync(this, timeout.Value)
171+
public Task EnsureExitAsync(TimeSpan? timeout) => timeout.HasValue
172+
? _currentState.ExitAsync(this, timeout.Value)
173173
: _currentState.KillAsync(this);
174174

175175
/// <summary>
@@ -194,7 +194,7 @@ public async Task<bool> WaitForExitAsync(TimeSpan? timeout)
194194

195195
await _exitCompletionSource.Task.ConfigureAwait(false);
196196
return true;
197-
}
197+
}
198198

199199
/// <inheritdoc />
200200
public override string ToString() => $"Chromium process; EndPoint={EndPoint}; State={_currentState}";
@@ -257,7 +257,7 @@ private static (List<string> chromiumArgs, TempDirectory tempUserDataDir) Prepar
257257
});
258258
}
259259

260-
if (!options.IgnoreDefaultArgs && options.Args.Any() && options.Args.All(arg => arg.StartsWith("-")))
260+
if (options.Args.All(arg => arg.StartsWith("-", StringComparison.Ordinal)))
261261
{
262262
chromiumArgs.Add("about:blank");
263263
}
@@ -462,7 +462,7 @@ public override Task ExitAsync(ChromiumProcess p, TimeSpan timeout)
462462
{
463463
Exited.EnterFrom(p, this);
464464
return Task.CompletedTask;
465-
}
465+
}
466466

467467
public override Task KillAsync(ChromiumProcess p)
468468
{
@@ -601,7 +601,7 @@ private class ExitingState : State
601601
{
602602
public Task EnterFromAsync(ChromiumProcess p, State fromState, TimeSpan timeout)
603603
{
604-
if (!TryEnter(p, fromState))
604+
if (!TryEnter(p, fromState))
605605
{
606606
return p._currentState.ExitAsync(p, timeout);
607607
}

0 commit comments

Comments
 (0)