[]
        
(Showing Draft Content)

GrapeCity.Documents.Html.LaunchOptions

Class LaunchOptions

Namespace
GrapeCity.Documents.Html
Assembly
GcDocs.Html.dll

Represents options for launching the browser.

public class LaunchOptions
Inheritance
object
LaunchOptions
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Constructors

LaunchOptions()

public LaunchOptions()

Properties

AuthServerAllowlist

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; }

Property Value

string

DefaultWindowSize

Gets or sets the default window size, in pixels.

public Size? DefaultWindowSize { get; set; }

Property Value

System.Drawing.Size?

DisablePdfTagging

Gets or sets a value indicating whether to do not emit tags when printing PDFs. Defaults to false.

public bool DisablePdfTagging { get; set; }

Property Value

bool

DumpToErrorStream

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; }

Property Value

bool

EnableGpuAcceleration

Gets or sets a value indicating whether GPU acceleration should be enabled. Defaults to false.

public bool EnableGpuAcceleration { get; set; }

Property Value

bool

ProxyServer

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; }

Property Value

string

RunWithNoSandbox

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; }

Property Value

bool

TimeoutOptions

Gets or sets the timeout settings for browser operations.

If not set, the default setting are used.

public TimeoutOptions TimeoutOptions { get; set; }

Property Value

TimeoutOptions

UserDataDir

Gets or sets the directory where the browser stores the user profile.

public string UserDataDir { get; set; }

Property Value

string

WebSocketFactory

Gets or sets the optional factory for System.Net.WebSockets.WebSocket implementations.

public WebSocketFactory WebSocketFactory { get; set; }

Property Value

WebSocketFactory

Remarks

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;
}