diff --git a/ElectronNET.API/App.cs b/ElectronNET.API/App.cs index e133c5c..793bb2a 100644 --- a/ElectronNET.API/App.cs +++ b/ElectronNET.API/App.cs @@ -539,9 +539,9 @@ namespace ElectronNET.API public Task GetNameAsync() => BridgeConnector.OnResult("appGetName", "appGetNameCompleted"); - internal App() + private App() { - CommandLine = new CommandLine(); + CommandLine = CommandLine.Instance; } internal static App Instance diff --git a/ElectronNET.API/CommandLine.cs b/ElectronNET.API/CommandLine.cs index 26a116c..40c48e4 100644 --- a/ElectronNET.API/CommandLine.cs +++ b/ElectronNET.API/CommandLine.cs @@ -8,7 +8,7 @@ namespace ElectronNET.API /// public sealed class CommandLine { - internal CommandLine() { } + private CommandLine() { } internal static CommandLine Instance { diff --git a/ElectronNET.API/Entities/TitleBarStyle.cs b/ElectronNET.API/Entities/TitleBarStyle.cs index 8fb108e..5ee48bc 100644 --- a/ElectronNET.API/Entities/TitleBarStyle.cs +++ b/ElectronNET.API/Entities/TitleBarStyle.cs @@ -28,4 +28,10 @@ namespace ElectronNET.API.Entities /// customButtonsOnHover } + + public class TitleBarOverlayConfig + { + public string Color { get; set; } + public string SymbolColor { get; set; } + } } \ No newline at end of file diff --git a/ElectronNET.API/Entities/WebPreferences.cs b/ElectronNET.API/Entities/WebPreferences.cs index f236247..ea4a1f1 100644 --- a/ElectronNET.API/Entities/WebPreferences.cs +++ b/ElectronNET.API/Entities/WebPreferences.cs @@ -171,6 +171,12 @@ namespace ElectronNET.API.Entities /// public bool Offscreen { get; set; } + /// + /// Whether to enable built-in spellcheck + /// + [DefaultValue(true)] + public bool Spellcheck { get; set; } = true; + /// /// 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 diff --git a/ElectronNET.Host/main.js b/ElectronNET.Host/main.js index 201d534..c1fbd73 100644 --- a/ElectronNET.Host/main.js +++ b/ElectronNET.Host/main.js @@ -54,6 +54,7 @@ app.on('before-quit-for-update', () => { }); const manifestJsonFile = require(manifestJsonFilePath); + if (manifestJsonFile.singleInstance || manifestJsonFile.aspCoreBackendPort) { const mainInstance = app.requestSingleInstanceLock(); app.on('second-instance', (events, args = []) => { @@ -81,6 +82,14 @@ if (manifestJsonFile.singleInstance || manifestJsonFile.aspCoreBackendPort) { } } +//Some flags need to be set before app is ready +if (manifestJsonFile.hasOwnProperty('cliFlags') && manifesJsonFile.cliFlags.length > 0) { + manifestJsonFile.cliFlags.forEach(flag => { + app.commandLine.appendSwitch(flag); + }); +} + + app.on('ready', () => { // Fix ERR_UNKNOWN_URL_SCHEME using file protocol