Update to native Electron 13.1.5, Update Changelog

This commit is contained in:
Gregor Biswanger
2021-07-02 02:04:23 +02:00
parent 305544ab42
commit ce0cdf39c6
55 changed files with 488 additions and 2150 deletions

View File

@@ -2340,58 +2340,5 @@ namespace ElectronNET.API
ContractResolver = new CamelCasePropertyNamesContractResolver(),
NullValueHandling = NullValueHandling.Ignore
};
/// <summary>
/// Adds Chrome extension located at path, and returns extension's name.
/// The method will also not return if the extension's manifest is missing or incomplete.
/// Note: This API cannot be called before the ready event of the app module is emitted.
/// </summary>
/// <param name="path">Path to the Chrome extension</param>
/// <returns></returns>
public static Task<string> AddExtensionAsync(string path)
{
var taskCompletionSource = new TaskCompletionSource<string>();
BridgeConnector.Socket.On("browserWindow-addExtension-completed", (extensionname) => {
BridgeConnector.Socket.Off("browserWindow-addExtension-completed");
taskCompletionSource.SetResult(extensionname.ToString());
});
BridgeConnector.Socket.Emit("browserWindowAddExtension", path);
return taskCompletionSource.Task;
}
/// <summary>
/// Remove Chrome extension with the specified name.
/// Note: This API cannot be called before the ready event of the app module is emitted.
/// </summary>
/// <param name="name">Name of the Chrome extension to remove</param>
public static void RemoveExtension(string name)
{
BridgeConnector.Socket.Emit("browserWindowRemoveExtension", name);
}
/// <summary>
/// The keys are the extension names and each value is an object containing name and version properties.
/// Note: This API cannot be called before the ready event of the app module is emitted.
/// </summary>
/// <returns></returns>
public static Task<ChromeExtensionInfo[]> GetExtensionsAsync()
{
var taskCompletionSource = new TaskCompletionSource<ChromeExtensionInfo[]>();
BridgeConnector.Socket.On("browserWindow-getExtensions-completed", (extensionslist) => {
BridgeConnector.Socket.Off("browserWindow-getExtensions-completed");
var chromeExtensionInfos = ((JArray)extensionslist).ToObject<ChromeExtensionInfo[]>();
taskCompletionSource.SetResult(chromeExtensionInfos);
});
BridgeConnector.Socket.Emit("browserWindowGetExtensions");
return taskCompletionSource.Task;
}
}
}