Skip to content

Commit 079273d

Browse files
kblokMeir017
authored andcommitted
Disable WebSocket ping (#428)
* Disable WebSocket ping * Obsoletes
1 parent 3e985c5 commit 079273d

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

lib/PuppeteerSharp/ConnectOptions.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace PuppeteerSharp
1+
using System;
2+
3+
namespace PuppeteerSharp
24
{
35
/// <summary>
46
/// Options for connecting to an existing browser.
@@ -28,6 +30,7 @@ public class ConnectOptions : IBrowserOptions
2830
/// <summary>
2931
/// Keep alive value.
3032
/// </summary>
31-
public int KeepAliveInterval { get; set; } = 30;
33+
[Obsolete("Chromium doesn't support pings yet (see: https://bugs.chromium.org/p/chromium/issues/detail?id=865002)")]
34+
public int KeepAliveInterval { get; set; } = 0;
3235
}
33-
}
36+
}

lib/PuppeteerSharp/LaunchOptions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ public class LaunchOptions : IBrowserOptions
7070
/// <summary>
7171
/// Keep alive value.
7272
/// </summary>
73-
public int KeepAliveInterval { get; set; } = 30;
73+
[Obsolete("Chromium doesn't support pings yet (see: https://bugs.chromium.org/p/chromium/issues/detail?id=865002)")]
74+
public int KeepAliveInterval { get; set; } = 0;
7475

7576
/// <summary>
7677
/// Logs process counts after launching chrome and after exiting.

lib/PuppeteerSharp/Launcher.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public async Task<Browser> LaunchAsync(LaunchOptions options)
114114
{
115115
var connectionDelay = options.SlowMo;
116116
var browserWSEndpoint = await WaitForEndpoint(_chromeProcess, options.Timeout);
117-
var keepAliveInterval = options.KeepAliveInterval;
117+
var keepAliveInterval = 0;
118118

119119
_connection = await Connection.Create(browserWSEndpoint, connectionDelay, keepAliveInterval, _loggerFactory);
120120
_processLoaded = true;
@@ -149,7 +149,7 @@ public async Task<Browser> ConnectAsync(ConnectOptions options)
149149
_chromiumLaunched = true;
150150

151151
var connectionDelay = options.SlowMo;
152-
var keepAliveInterval = options.KeepAliveInterval;
152+
var keepAliveInterval = 0;
153153

154154
_connection = await Connection.Create(options.BrowserWSEndpoint, connectionDelay, keepAliveInterval, _loggerFactory);
155155

0 commit comments

Comments
 (0)