using System.ComponentModel; namespace ElectronNET.API.Entities { /// /// /// public class WebPreferences { /// /// Whether to enable DevTools. If it is set to false, can not use /// BrowserWindow.webContents.openDevTools() to open DevTools.Default is true. /// [DefaultValue(true)] public bool DevTools { get; set; } = true; /// /// Whether node integration is enabled. Default is true. /// [DefaultValue(true)] public bool NodeIntegration { get; set; } = true; /// /// Whether node integration is enabled in web workers. Default is false. /// public bool NodeIntegrationInWorker { get; set; } /// /// Specifies a script that will be loaded before other scripts run in the page. /// This script will always have access to node APIs no matter whether node /// integration is turned on or off.The value should be the absolute file path to /// the script. When node integration is turned off, the preload script can /// reintroduce Node global symbols back to the global scope. /// public string Preload { get; set; } /// /// If set, this will sandbox the renderer associated with the window, making it /// compatible with the Chromium OS-level sandbox and disabling the Node.js engine. /// This is not the same as the nodeIntegration option and the APIs available to the /// preload script are more limited. Read more about the option.This option is /// currently experimental and may change or be removed in future Electron releases. /// public bool Sandbox { get; set; } /// /// Sets the session used by the page according to the session's partition string. /// If partition starts with persist:, the page will use a persistent session /// available to all pages in the app with the same partition.If there is no /// persist: prefix, the page will use an in-memory session. By assigning the same /// partition, multiple pages can share the same session.Default is the default /// session. /// public string Partition { get; set; } /// /// The default zoom factor of the page, 3.0 represents 300%. Default is 1.0. /// public int ZoomFactor { get; set; } /// /// Enables JavaScript support. Default is true. /// [DefaultValue(true)] public bool Javascript { get; set; } = true; /// /// When false, it will disable the same-origin policy (usually using testing /// websites by people), and set allowRunningInsecureContent to true if this options /// has not been set by user. Default is true. /// [DefaultValue(true)] public bool WebSecurity { get; set; } = true; /// /// Allow an https page to run JavaScript, CSS or plugins from http URLs. Default is /// false. /// public bool AllowRunningInsecureContent { get; set; } /// /// Enables image support. Default is true. /// [DefaultValue(true)] public bool Images { get; set; } = true; /// /// Make TextArea elements resizable. Default is true. /// [DefaultValue(true)] public bool TextAreasAreResizable { get; set; } = true; /// /// Enables WebGL support. Default is true. /// [DefaultValue(true)] public bool Webgl { get; set; } = true; /// /// Enables WebAudio support. Default is true. /// [DefaultValue(true)] public bool Webaudio { get; set; } = true; /// /// Whether plugins should be enabled. Default is false. /// public bool Plugins { get; set; } /// /// Enables Chromium's experimental features. Default is false. /// public bool ExperimentalFeatures { get; set; } /// /// Enables Chromium's experimental canvas features. Default is false. /// public bool ExperimentalCanvasFeatures { get; set; } /// /// Enables scroll bounce (rubber banding) effect on macOS. Default is false. /// public bool ScrollBounce { get; set; } /// /// A list of feature strings separated by ,, like CSSVariables,KeyboardEventKey to /// enable.The full list of supported feature strings can be found in the file. /// public string EnableBlinkFeatures { get; set; } /// /// A list of feature strings separated by ,, like CSSVariables,KeyboardEventKey to /// disable.The full list of supported feature strings can be found in the file. /// public string DisableBlinkFeatures { get; set; } /// /// Sets the default font for the font-family. /// public DefaultFontFamily DefaultFontFamily { get; set; } /// /// Defaults to 16. /// public int DefaultFontSize { get; set; } /// /// Defaults to 13. /// public int DefaultMonospaceFontSize { get; set; } /// /// Defaults to 0. /// public int MinimumFontSize { get; set; } /// /// Defaults to ISO-8859-1. /// public string DefaultEncoding { get; set; } /// /// Whether to throttle animations and timers when the page becomes background. This /// also affects the[Page Visibility API][#page-visibility]. Defaults to true. /// [DefaultValue(true)] public bool BackgroundThrottling { get; set; } = true; /// /// Whether to enable offscreen rendering for the browser window. Defaults to false. /// public bool Offscreen { get; set; } /// /// Whether to run Electron APIs and the specified preload script in a separate /// JavaScript context.Defaults to false. The context that the preload script runs /// in will still have full access to the document and window globals but it will /// use its own set of JavaScript builtins (Array, Object, JSON, etc.) and will be /// isolated from any changes made to the global environment by the loaded page.The /// Electron API will only be available in the preload script and not the loaded /// page. This option should be used when loading potentially untrusted remote /// content to ensure the loaded content cannot tamper with the preload script and /// any Electron APIs being used. This option uses the same technique used by . You /// can access this context in the dev tools by selecting the 'Electron Isolated /// Context' entry in the combo box at the top of the Console tab. This option is /// currently experimental and may change or be removed in future Electron releases. /// [DefaultValue(true)] public bool ContextIsolation { get; set; } = true; /// /// Whether to use native window.open(). Defaults to false. This option is currently experimental. /// public bool NativeWindowOpen { get; set; } /// /// Whether to enable the Webview. Defaults to the value of the nodeIntegration option. The /// preload script configured for the Webview will have node integration enabled /// when it is executed so you should ensure remote/untrusted content is not able to /// create a Webview tag with a possibly malicious preload script.You can use the /// will-attach-webview event on to strip away the preload script and to validate or /// alter the Webview's initial settings. /// /// /// true if [webview tag]; otherwise, false. /// [DefaultValue(false)] public bool WebviewTag { get; set; } = false; } }