From 5718e5adf1c1d39bf977517c6600f424633823fd Mon Sep 17 00:00:00 2001 From: Gregor Biswanger Date: Thu, 26 Oct 2017 21:49:53 +0200 Subject: [PATCH] Update WebPreferences with default values --- ElectronNET.API/Entities/WebPreferences.cs | 33 +++++++++++++------- ElectronNET.WebApp/ElectronNET.WebApp.csproj | 3 -- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/ElectronNET.API/Entities/WebPreferences.cs b/ElectronNET.API/Entities/WebPreferences.cs index 11c562b..2661210 100644 --- a/ElectronNET.API/Entities/WebPreferences.cs +++ b/ElectronNET.API/Entities/WebPreferences.cs @@ -1,4 +1,6 @@ -namespace ElectronNET.API.Entities +using System.ComponentModel; + +namespace ElectronNET.API.Entities { /// /// @@ -9,12 +11,14 @@ /// Whether to enable DevTools. If it is set to false, can not use /// BrowserWindow.webContents.openDevTools() to open DevTools.Default is true. /// - public bool DevTools { get; set; } + [DefaultValue(true)] + public bool DevTools { get; set; } = true; /// /// Whether node integration is enabled. Default is true. /// - public bool NodeIntegration { get; set; } + [DefaultValue(true)] + public bool NodeIntegration { get; set; } = true; /// /// Whether node integration is enabled in web workers. Default is false. @@ -57,14 +61,16 @@ /// /// Enables JavaScript support. Default is true. /// - public bool Javascript { get; set; } + [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. + /// has not been set by user. Default is true. /// - public bool WebSecurity { get; set; } + [DefaultValue(true)] + public bool WebSecurity { get; set; } = true; /// /// Allow an https page to run JavaScript, CSS or plugins from http URLs. Default is @@ -75,22 +81,26 @@ /// /// Enables image support. Default is true. /// - public bool Images { get; set; } + [DefaultValue(true)] + public bool Images { get; set; } = true; /// /// Make TextArea elements resizable. Default is true. /// - public bool TextAreasAreResizable { get; set; } + [DefaultValue(true)] + public bool TextAreasAreResizable { get; set; } = true; /// /// Enables WebGL support. Default is true. /// - public bool Webgl { get; set; } + [DefaultValue(true)] + public bool Webgl { get; set; } = true; /// /// Enables WebAudio support. Default is true. /// - public bool Webaudio { get; set; } + [DefaultValue(true)] + public bool Webaudio { get; set; } = true; /// /// Whether plugins should be enabled. Default is false. @@ -153,7 +163,8 @@ /// Whether to throttle animations and timers when the page becomes background. This /// also affects the[Page Visibility API][#page-visibility]. Defaults to true. /// - public bool BackgroundThrottling { get; set; } + [DefaultValue(true)] + public bool BackgroundThrottling { get; set; } = true; /// /// Whether to enable offscreen rendering for the browser window. Defaults to false. diff --git a/ElectronNET.WebApp/ElectronNET.WebApp.csproj b/ElectronNET.WebApp/ElectronNET.WebApp.csproj index 5344c80..d6b4472 100644 --- a/ElectronNET.WebApp/ElectronNET.WebApp.csproj +++ b/ElectronNET.WebApp/ElectronNET.WebApp.csproj @@ -28,9 +28,6 @@ - - - PreserveNewest