Skip to content

Commit ce0cdf3

Browse files
Update to native Electron 13.1.5, Update Changelog
1 parent 305544a commit ce0cdf3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+489
-2151
lines changed

Changelog.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
# Not released
22

3-
# 11.5.2
3+
# 13.5.1
4+
5+
ElectronNET.CLI:
6+
7+
* New Feature: Using exit code instead of seek for the term 'error' (thanks [TSrgy](https://github.com/TSrgy)) [\#562](https://github.com/ElectronNET/Electron.NET/pull/562)
8+
* Fixed bug: Allow for property overrides to be passed in (thanks [danatcofo](https://github.com/danatcofo)) [\#531](https://github.com/ElectronNET/Electron.NET/pull/531)
9+
Use `/p:propertyName=value` or `/property:propertyName=value` to pass in property overrides. This is equivalent to the `-p:` option documented here: [https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish)
10+
* Fixed bug: Add ability to pass an argument for "Version" for both the "dotnet publish" and "electron-builder" commands (thanks [tub5](https://github.com/tub5)) [\#546](https://github.com/ElectronNET/Electron.NET/pull/546)
11+
* Fixed bug: Changes PublishSingleFile default to false for NET5 compatibility (thanks [cristiangiagante](https://github.com/cristiangiagante)) [\#570](https://github.com/ElectronNET/Electron.NET/pull/570)
12+
13+
ElectronNET.API:
14+
15+
* New Feature: Native Electron 13.1.5 support, but not all new features (we search contributors)
16+
* Breaking API Changes (from native Electron 13.1.5):
17+
- `Shell.MoveItemToTrashAsync` renamed with `Shell.TrashItemAsync`
18+
- The deprecated extension APIs have been removed: `BrowserWindow.GetAllExtensionsAsync()`, `BrowserWindow.RemoveExtension()`, `BrowserWindow.AddExtensionAsync()`. Use the session APIs instead: `Session.GetAllExtensionsAsync()`, `Session.RemoveExtension()`, `Session.LoadExtensionAsync()`.
19+
* New Feature: Add WebContents [insertCSS](https://www.electronjs.org/docs/api/web-contents#contentsinsertcsscss-options) functionality (thanks [nfichter](https://github.com/nfichter)) [\#559](https://github.com/ElectronNET/Electron.NET/pull/559)
20+
* New Feature: Allow IpcMain to send IPC messages to BrowserViews (thanks [nfichter](https://github.com/nfichter)) [\#560](https://github.com/ElectronNET/Electron.NET/pull/560)
21+
* New Feature: Add support for proxies that require basic username/password authentication (thanks [nfichter](https://github.com/nfichter)) [\#561](https://github.com/ElectronNET/Electron.NET/pull/561)
22+
* New Feature: Add PostData to LoadURLOptions to allow http-posts in LoadURL calls (thanks [Funkrusha](https://github.com/Funkrusha)) [\#547](https://github.com/ElectronNET/Electron.NET/pull/547)
23+
* Fixed bug: Fix splash screen interaction causing crashes, ghost dragging, and resizable behavior #540 (thanks [MiniguyBrendan](https://github.com/MiniguyBrendan)) [\#540](https://github.com/ElectronNET/Electron.NET/pull/540)
24+
* Fixed bug: Vibrancy serialization fix (thanks [tantumalice](https://github.com/tantumalice)) [\#573](https://github.com/ElectronNET/Electron.NET/pull/573)
25+
426

527
# Released
628

ElectronNET.API/BrowserWindow.cs

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2340,58 +2340,5 @@ public void SetBrowserView(BrowserView browserView)
23402340
ContractResolver = new CamelCasePropertyNamesContractResolver(),
23412341
NullValueHandling = NullValueHandling.Ignore
23422342
};
2343-
2344-
/// <summary>
2345-
/// Adds Chrome extension located at path, and returns extension's name.
2346-
/// The method will also not return if the extension's manifest is missing or incomplete.
2347-
/// Note: This API cannot be called before the ready event of the app module is emitted.
2348-
/// </summary>
2349-
/// <param name="path">Path to the Chrome extension</param>
2350-
/// <returns></returns>
2351-
public static Task<string> AddExtensionAsync(string path)
2352-
{
2353-
var taskCompletionSource = new TaskCompletionSource<string>();
2354-
2355-
BridgeConnector.Socket.On("browserWindow-addExtension-completed", (extensionname) => {
2356-
BridgeConnector.Socket.Off("browserWindow-addExtension-completed");
2357-
2358-
taskCompletionSource.SetResult(extensionname.ToString());
2359-
});
2360-
2361-
BridgeConnector.Socket.Emit("browserWindowAddExtension", path);
2362-
2363-
return taskCompletionSource.Task;
2364-
}
2365-
2366-
/// <summary>
2367-
/// Remove Chrome extension with the specified name.
2368-
/// Note: This API cannot be called before the ready event of the app module is emitted.
2369-
/// </summary>
2370-
/// <param name="name">Name of the Chrome extension to remove</param>
2371-
public static void RemoveExtension(string name)
2372-
{
2373-
BridgeConnector.Socket.Emit("browserWindowRemoveExtension", name);
2374-
}
2375-
2376-
/// <summary>
2377-
/// The keys are the extension names and each value is an object containing name and version properties.
2378-
/// Note: This API cannot be called before the ready event of the app module is emitted.
2379-
/// </summary>
2380-
/// <returns></returns>
2381-
public static Task<ChromeExtensionInfo[]> GetExtensionsAsync()
2382-
{
2383-
var taskCompletionSource = new TaskCompletionSource<ChromeExtensionInfo[]>();
2384-
2385-
BridgeConnector.Socket.On("browserWindow-getExtensions-completed", (extensionslist) => {
2386-
BridgeConnector.Socket.Off("browserWindow-getExtensions-completed");
2387-
var chromeExtensionInfos = ((JArray)extensionslist).ToObject<ChromeExtensionInfo[]>();
2388-
2389-
taskCompletionSource.SetResult(chromeExtensionInfos);
2390-
});
2391-
2392-
BridgeConnector.Socket.Emit("browserWindowGetExtensions");
2393-
2394-
return taskCompletionSource.Task;
2395-
}
23962343
}
23972344
}

ElectronNET.API/Entities/Extension.cs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace ElectronNET.API.Entities
8+
{
9+
/// <summary>
10+
/// Docs: https://electronjs.org/docs/api/structures/extension
11+
/// </summary>
12+
public class Extension
13+
{
14+
/// <summary>
15+
///
16+
/// </summary>
17+
public string Id { get; set; }
18+
19+
/// <summary>
20+
/// Copy of the extension's manifest data.
21+
/// </summary>
22+
public dynamic Manifest { get; set; }
23+
24+
/// <summary>
25+
///
26+
/// </summary>
27+
public string Name { get; set; }
28+
29+
/// <summary>
30+
/// The extension's file path.
31+
/// </summary>
32+
public string Path { get; set; }
33+
34+
/// <summary>
35+
/// The extension's `chrome-extension://` URL.
36+
/// </summary>
37+
public string Url { get; set; }
38+
39+
/// <summary>
40+
///
41+
/// </summary>
42+
public string Version { get; set; }
43+
}
44+
}

ElectronNET.API/Entities/WebPreferences.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ public class WebPreferences
185185
/// Context' entry in the combo box at the top of the Console tab. This option is
186186
/// currently experimental and may change or be removed in future Electron releases.
187187
/// </summary>
188-
[DefaultValue(true)]
189-
public bool ContextIsolation { get; set; } = true;
188+
[DefaultValue(false)]
189+
public bool ContextIsolation { get; set; } = false;
190190

191191
/// <summary>
192192
/// Whether to use native window.open(). Defaults to false. This option is currently experimental.

ElectronNET.API/Session.cs

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,81 @@ public void SetUserAgent(string userAgent, string acceptLanguages)
375375
BridgeConnector.Socket.Emit("webContents-session-setUserAgent", Id, userAgent, acceptLanguages);
376376
}
377377

378+
/// <summary>
379+
/// The keys are the extension names and each value is an object containing name and version properties.
380+
/// Note: This API cannot be called before the ready event of the app module is emitted.
381+
/// </summary>
382+
/// <returns></returns>
383+
public Task<ChromeExtensionInfo[]> GetAllExtensionsAsync()
384+
{
385+
var taskCompletionSource = new TaskCompletionSource<ChromeExtensionInfo[]>();
386+
387+
BridgeConnector.Socket.On("webContents-session-getAllExtensions-completed", (extensionslist) =>
388+
{
389+
BridgeConnector.Socket.Off("webContents-session-getAllExtensions-completed");
390+
var chromeExtensionInfos = ((JArray)extensionslist).ToObject<ChromeExtensionInfo[]>();
391+
392+
taskCompletionSource.SetResult(chromeExtensionInfos);
393+
});
394+
395+
BridgeConnector.Socket.Emit("webContents-session-getAllExtensions", Id);
396+
397+
return taskCompletionSource.Task;
398+
}
399+
400+
/// <summary>
401+
/// Remove Chrome extension with the specified name.
402+
/// Note: This API cannot be called before the ready event of the app module is emitted.
403+
/// </summary>
404+
/// <param name="name">Name of the Chrome extension to remove</param>
405+
public void RemoveExtension(string name)
406+
{
407+
BridgeConnector.Socket.Emit("webContents-session-removeExtension", Id, name);
408+
}
409+
410+
/// <summary>
411+
/// resolves when the extension is loaded.
412+
///
413+
/// This method will raise an exception if the extension could not be loaded.If
414+
/// there are warnings when installing the extension (e.g. if the extension requests
415+
/// an API that Electron does not support) then they will be logged to the console.
416+
///
417+
/// Note that Electron does not support the full range of Chrome extensions APIs.
418+
/// See Supported Extensions APIs for more details on what is supported.
419+
///
420+
/// Note that in previous versions of Electron, extensions that were loaded would be
421+
/// remembered for future runs of the application.This is no longer the case:
422+
/// `loadExtension` must be called on every boot of your app if you want the
423+
/// extension to be loaded.
424+
///
425+
/// This API does not support loading packed (.crx) extensions.
426+
///
427+
///** Note:** This API cannot be called before the `ready` event of the `app` module
428+
/// is emitted.
429+
///
430+
///** Note:** Loading extensions into in-memory(non-persistent) sessions is not supported and will throw an error.
431+
/// </summary>
432+
/// <param name="path">Path to the Chrome extension</param>
433+
/// <param name="allowFileAccess">Whether to allow the extension to read local files over `file://` protocol and
434+
/// inject content scripts into `file://` pages. This is required e.g. for loading
435+
/// devtools extensions on `file://` URLs. Defaults to false.</param>
436+
/// <returns></returns>
437+
public Task<Extension> LoadExtensionAsync(string path, bool allowFileAccess = false)
438+
{
439+
var taskCompletionSource = new TaskCompletionSource<Extension>();
440+
441+
BridgeConnector.Socket.On("webContents-session-loadExtension-completed", (extension) =>
442+
{
443+
BridgeConnector.Socket.Off("webContents-session-loadExtension-completed");
444+
445+
taskCompletionSource.SetResult(((JObject)extension).ToObject<Extension>());
446+
});
447+
448+
BridgeConnector.Socket.Emit("webContents-session-loadExtension", Id, path, allowFileAccess);
449+
450+
return taskCompletionSource.Task;
451+
}
452+
378453
private JsonSerializer _jsonSerializer = new JsonSerializer()
379454
{
380455
ContractResolver = new CamelCasePropertyNamesContractResolver(),

ElectronNET.API/Shell.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,19 @@ public Task<string> OpenExternalAsync(string url, OpenExternalOptions options)
120120
/// Move the given file to trash and returns a <see cref="bool"/> status for the operation.
121121
/// </summary>
122122
/// <param name="fullPath">The full path to the directory / file.</param>
123-
/// <param name="deleteOnFail">Whether or not to unilaterally remove the item if the Trash is disabled or unsupported on the volume.</param>
124123
/// <returns> Whether the item was successfully moved to the trash.</returns>
125-
public Task<bool> MoveItemToTrashAsync(string fullPath, bool deleteOnFail)
124+
public Task<bool> TrashItemAsync(string fullPath)
126125
{
127126
var taskCompletionSource = new TaskCompletionSource<bool>();
128127

129-
BridgeConnector.Socket.On("shell-moveItemToTrashCompleted", (success) =>
128+
BridgeConnector.Socket.On("shell-trashItem-completed", (success) =>
130129
{
131-
BridgeConnector.Socket.Off("shell-moveItemToTrashCompleted");
130+
BridgeConnector.Socket.Off("shell-trashItem-completed");
132131

133132
taskCompletionSource.SetResult((bool) success);
134133
});
135134

136-
BridgeConnector.Socket.Emit("shell-moveItemToTrash", fullPath, deleteOnFail);
135+
BridgeConnector.Socket.Emit("shell-trashItem", fullPath);
137136

138137
return taskCompletionSource.Task;
139138
}

ElectronNET.CLI/Commands/BuildCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public Task<bool> ExecuteAsync()
198198
: $"node build-helper.js {manifestFileName} {version}", tempPath);
199199

200200
Console.WriteLine($"Package Electron App for Platform {platformInfo.ElectronPackerPlatform}...");
201-
ProcessHelper.CmdExecute($"npx electron-builder --config=./bin/electron-builder.json --{platformInfo.ElectronPackerPlatform} --{electronArch} -c.electronVersion=12.0.12 {electronParams}", tempPath);
201+
ProcessHelper.CmdExecute($"npx electron-builder --config=./bin/electron-builder.json --{platformInfo.ElectronPackerPlatform} --{electronArch} -c.electronVersion=13.1.5 {electronParams}", tempPath);
202202

203203
Console.WriteLine("... done");
204204

ElectronNET.Host/ElectronHostHook/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
"license": "MIT",
1515
"devDependencies": {
1616
"@types/socket.io": "^2.1.12",
17-
"typescript": "^4.1.3"
17+
"typescript": "^4.3.5"
1818
}
1919
}

0 commit comments

Comments
 (0)