- Added AddExtension, RemoveExtension and GetExtensions methods body

- Added a ChromeExtensionInfo class, that mimic the returned JS values from GetExtensions method (see https://electronjs.org/docs/api/browser-window#browserwindowgetextensions)
- GetExtensions return a Dictionary<string, ChromeExtensionInfo>, to respect JS documentation declaration.
This commit is contained in:
Guillaume
2019-09-25 17:33:57 +02:00
parent 5157561dc6
commit ba64639c1d
2 changed files with 70 additions and 0 deletions

View File

@@ -2310,5 +2310,37 @@ 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 string AddExtension(string path)
{
throw new NotImplementedException();
}
/// <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)
{
throw new NotImplementedException();
}
/// <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 Dictionary<string, ChromeExtensionInfo> GetExtensions()
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace ElectronNET.API.Entities
{
/// <summary>
/// Provide metadata about the current loaded Chrome extension
/// </summary>
public class ChromeExtensionInfo
{
private string _name;
private string _version;
internal ChromeExtensionInfo(string name, string version)
{
_name = name;
_version = version;
}
/// <summary>
/// Name of the Chrome extension
/// </summary>
public string Name
{
get => _name;
}
/// <summary>
/// Version of the Chrome extension
/// </summary>
public string Version
{
get => _version;
}
}
}