[]
Represents options for launching the browser.
public class LaunchOptions
public LaunchOptions()
Gets or sets a whitelist to passthrough Windows authentication for the specified domains.
For example: "*example.com,*foobar.com,*baz".
public string AuthServerAllowlist { get; set; }
Gets or sets the default window size, in pixels.
public Size? DefaultWindowSize { get; set; }
Gets or sets a value indicating whether to do not emit tags when printing PDFs. Defaults to false.
public bool DisablePdfTagging { get; set; }
Gets or sets a value indicating whether to pipe browser process stderr into the application process stderr. Defaults to false.
public bool DumpToErrorStream { get; set; }
Gets or sets a value indicating whether GPU acceleration should be enabled. Defaults to false.
public bool EnableGpuAcceleration { get; set; }
Gets or sets a proxy server, overrides system settings. Affects HTTP and HTTPS requests only.
For example: "https://proxy-ip:proxy-port" or "socks5://127.0.0.1:1080".
public string ProxyServer { get; set; }
Gets or sets whether a sandbox should be disabled to prevent issues on Linux. Use it if you absolutely trust the content you open. Defaults to false.
public bool RunWithNoSandbox { get; set; }
Gets or sets the timeout settings for browser operations.
If not set, the default setting are used.
public TimeoutOptions TimeoutOptions { get; set; }
Gets or sets the directory where the browser stores the user profile.
public string UserDataDir { get; set; }
Gets or sets the optional factory for System.Net.WebSockets.WebSocket implementations.
public WebSocketFactory WebSocketFactory { get; set; }
If you need to run GcHtmlBrowser on Windows 7, you can use WebSocketFactory to inject System.Net.WebSockets.Client.Managed.
WebSocketFactory = async (uri) =>
{
var client = SystemClientWebSocket.CreateClientWebSocket();
if (client is System.Net.WebSockets.Managed.ClientWebSocket managed)
{
managed.Options.KeepAliveInterval = TimeSpan.FromSeconds(0);
await managed.ConnectAsync(uri, default);
}
else
{
var coreSocket = client as ClientWebSocket;
coreSocket.Options.KeepAliveInterval = TimeSpan.FromSeconds(0);
await coreSocket.ConnectAsync(uri, default);
}
return client;
}