ContextOptions Class#
Options for creating a new browser context.
public sealed record ContextOptions : System.IEquatable<Motus.Abstractions.ContextOptions>
Inheritance System.Object → ContextOptions
Implements System.IEquatable<ContextOptions>
Properties#
BaseURL Property#
Base URL to use for relative URL navigations.
public string? BaseURL { get; init; }
Property Value#
ColorScheme Property#
The preferred color scheme.
public System.Nullable<Motus.Abstractions.ColorScheme> ColorScheme { get; init; }
Property Value#
ExtraHttpHeaders Property#
Extra HTTP headers to send with every request.
public System.Collections.Generic.IDictionary<string,string>? ExtraHttpHeaders { get; init; }
Property Value#
System.Collections.Generic.IDictionary<System.String,System.String>
Geolocation Property#
The geolocation to emulate.
public Motus.Abstractions.Geolocation? Geolocation { get; init; }
Property Value#
HttpCredentials Property#
HTTP credentials for HTTP authentication.
public Motus.Abstractions.HttpCredentials? HttpCredentials { get; init; }
Property Value#
IgnoreHTTPSErrors Property#
Whether to ignore HTTPS errors.
public bool IgnoreHTTPSErrors { get; init; }
Property Value#
Locale Property#
The locale to use, e.g. "en-US".
public string? Locale { get; init; }
Property Value#
NaturalMouseMotion Property#
Makes mouse movement follow a curved, eased, time-spaced path instead of jumping straight to the target, so motion looks human in recordings and the page receives a realistic event stream. Adds latency to every move. Off by default.
public bool NaturalMouseMotion { get; init; }
Property Value#
Permissions Property#
Permissions to grant to all pages in this context.
public System.Collections.Generic.IReadOnlyList<string>? Permissions { get; init; }
Property Value#
System.Collections.Generic.IReadOnlyList<System.String>
Proxy Property#
Proxy settings for this context.
public Motus.Abstractions.ProxySettings? Proxy { get; init; }
Property Value#
RecordVideo Property#
Whether to record video for all pages. Requires RecordVideoOptions.
public Motus.Abstractions.RecordVideoOptions? RecordVideo { get; init; }
Property Value#
ShowCursor Property#
Draws an on-screen pseudo-cursor in every page of the context. Synthetic input does not move the OS pointer and screen capture does not record it, so this injected overlay is the only way to show where actions occur in screenshots and recordings. The cursor follows the element's CSS cursor style and renders a click effect. Off by default.
public bool ShowCursor { get; init; }
Property Value#
StorageState Property#
Storage state to initialize the context with.
public Motus.Abstractions.StorageState? StorageState { get; init; }
Property Value#
TimezoneId Property#
The timezone identifier, e.g. "America/New_York".
public string? TimezoneId { get; init; }
Property Value#
UserAgent Property#
The user agent string to use.
public string? UserAgent { get; init; }
Property Value#
Viewport Property#
The viewport size. Null disables the default viewport.
public Motus.Abstractions.ViewportSize? Viewport { get; init; }