Implement Electron 5.0.1 compatibility

This commit is contained in:
Gregor Biswanger
2019-05-16 03:13:35 +02:00
parent aea2c7aff5
commit 3cb92169dd
14 changed files with 59 additions and 42 deletions

View File

@@ -1414,14 +1414,6 @@ namespace ElectronNET.API
BridgeConnector.Socket.Emit("appCommandLineAppendArgument", value);
}
/// <summary>
/// Enables mixed sandbox mode on the app. This method can only be called before app is ready.
/// </summary>
public void EnableMixedSandbox()
{
BridgeConnector.Socket.Emit("appEnableMixedSandbox");
}
/// <summary>
/// When critical is passed, the dock icon will bounce until either the application
/// becomes active or the request is canceled.When informational is passed, the

View File

@@ -185,7 +185,8 @@ namespace ElectronNET.API.Entities
/// 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.
/// </summary>
public bool ContextIsolation { get; set; }
[DefaultValue(true)]
public bool ContextIsolation { get; set; } = true;
/// <summary>
/// Whether to use native window.open(). Defaults to false. This option is currently experimental.
@@ -203,6 +204,7 @@ namespace ElectronNET.API.Entities
/// <value>
/// <c>true</c> if [webview tag]; otherwise, <c>false</c>.
/// </value>
public bool WebviewTag { get; set; }
[DefaultValue(false)]
public bool WebviewTag { get; set; } = false;
}
}

View File

@@ -132,10 +132,10 @@ namespace ElectronNET.API
/// </summary>
/// <param name="url"></param>
/// <param name="options">macOS only</param>
/// <param name="action">macOS only</param>
/// <param name="errorAction">Action to get the error message.</param>
/// <returns>Whether an application was available to open the URL.
/// If callback is specified, always returns true.</returns>
public Task<bool> OpenExternalAsync(string url, OpenExternalOptions options, Action<Error> action)
public Task<bool> OpenExternalAsync(string url, OpenExternalOptions options, Action<Error> errorAction)
{
var taskCompletionSource = new TaskCompletionSource<bool>();
@@ -157,7 +157,7 @@ namespace ElectronNET.API
}
});
_openExternalCallbacks.Add(url, action);
_openExternalCallbacks.Add(url, errorAction);
BridgeConnector.Socket.Emit("shell-openExternal", url, JObject.FromObject(options, _jsonSerializer), true);