Skip to content

Commit f06b958

Browse files
Update to native Electron 11.1.1 - Fix breaking changes and refactoring.
1 parent b9feff3 commit f06b958

Some content is hidden

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

45 files changed

+2083
-718
lines changed

Changelog.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Not released
22

3-
# 9.31.3
3+
# 11.5.1
44

55
ElectronNET.CLI:
66

7+
* New Feature: Added new build and start commandline options for single exe (thanks [nathanwienand](https://github.com/nathanwienand)) [\#506](https://github.com/ElectronNET/Electron.NET/pull/506)
78
* New Feature: Set a description of the app in `electron.manifest.json` (thanks [BurtsevC](https://github.com/BurtsevC)) [\#433](https://github.com/ElectronNET/Electron.NET/pull/433)
89
* New Feature: Set a target for the start command (thanks [gabecook](https://github.com/gabecook)) [\#463](https://github.com/ElectronNET/Electron.NET/pull/463)
910
* New Feature: `electronize init` support for F# projects (thanks [kojo12228](https://github.com/kojo12228)) [\#457](https://github.com/ElectronNET/Electron.NET/pull/457)
@@ -12,7 +13,12 @@ ElectronNET.CLI:
1213

1314
ElectronNET.API:
1415

15-
* New Feature: Native Electron 9.2.0 support, but not all new features (we search contributors)
16+
* New Feature: Native Electron 11.1.1 support, but not all new features (we search contributors)
17+
* Breaking API Changes (from native Electron 11.0): - Removed: BrowserView.{destroy, fromId, fromWebContents, getAllViews} and id property of BrowserView
18+
* New Feature: Upgrade to .NET 5 (thanks [scottkuhl](https://github.com/scottkuhl)) [\#509](https://github.com/ElectronNET/Electron.NET/pull/509)
19+
* New Feature: Adding a configurable default electron port. (thanks [aarong-av](https://github.com/aarong-av)) [\#505](https://github.com/ElectronNET/Electron.NET/pull/505)
20+
* New Feature: Added support for launching the application with a file on MacOS (thanks [dlitty](https://github.com/dlitty)) [\#478](https://github.com/ElectronNET/Electron.NET/pull/478)
21+
* Improved: Avoid Blocking Calls in App and AutoUpdater (thanks [freosc](https://github.com/freosc)) [\#474](https://github.com/ElectronNET/Electron.NET/pull/474)
1622
* Fixed bug: Set default WebPreferences.DefaultFontSize (thanks [duncanawoods](https://github.com/duncanawoods)) [\#468](https://github.com/ElectronNET/Electron.NET/pull/468)
1723

1824
# Released

ElectronNET.API/BrowserView.cs

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
using Newtonsoft.Json;
33
using Newtonsoft.Json.Linq;
44
using Newtonsoft.Json.Serialization;
5-
using System;
6-
using System.Collections.Generic;
7-
using System.Text;
85
using System.Threading.Tasks;
96

107
namespace ElectronNET.API
@@ -29,30 +26,6 @@ public class BrowserView
2926
/// </summary>
3027
public WebContents WebContents { get; internal set; }
3128

32-
/// <summary>
33-
/// Whether the view is destroyed.
34-
/// </summary>
35-
public Task<bool> IsDestroyedAsync
36-
{
37-
get
38-
{
39-
return Task.Run<bool>(() =>
40-
{
41-
var taskCompletionSource = new TaskCompletionSource<bool>();
42-
43-
BridgeConnector.Socket.On("browserView-isDestroyed-reply", (result) =>
44-
{
45-
BridgeConnector.Socket.Off("browserView-isDestroyed-reply");
46-
taskCompletionSource.SetResult((bool)result);
47-
});
48-
49-
BridgeConnector.Socket.Emit("browserView-isDestroyed", Id);
50-
51-
return taskCompletionSource.Task;
52-
});
53-
}
54-
}
55-
5629
/// <summary>
5730
/// Resizes and moves the view to the supplied bounds relative to the window.
5831
///
@@ -83,8 +56,6 @@ public Rectangle Bounds
8356
}
8457
}
8558

86-
internal Action<BrowserView> Destroyed;
87-
8859
/// <summary>
8960
/// BrowserView
9061
/// </summary>
@@ -97,18 +68,6 @@ internal BrowserView(int id)
9768
WebContents = new WebContents(id + 1000);
9869
}
9970

100-
/// <summary>
101-
/// Force closing the view, the `unload` and `beforeunload` events won't be emitted
102-
/// for the web page.After you're done with a view, call this function in order to
103-
/// free memory and other resources as soon as possible.
104-
/// </summary>
105-
public void Destroy()
106-
{
107-
BridgeConnector.Socket.Emit("browserView-destroy", Id);
108-
109-
Destroyed?.Invoke(this);
110-
}
111-
11271
/// <summary>
11372
/// (experimental)
11473
/// </summary>

ElectronNET.API/Entities/RemoveClientCertificate.cs

Lines changed: 0 additions & 31 deletions
This file was deleted.

ElectronNET.API/Session.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ public Task ClearAuthCacheAsync(RemovePassword options)
6464
/// <summary>
6565
/// Clears the session’s HTTP authentication cache.
6666
/// </summary>
67-
/// <param name="options"></param>
68-
public Task ClearAuthCacheAsync(RemoveClientCertificate options)
67+
public Task ClearAuthCacheAsync()
6968
{
7069
var taskCompletionSource = new TaskCompletionSource<object>();
7170
string guid = Guid.NewGuid().ToString();
@@ -76,7 +75,7 @@ public Task ClearAuthCacheAsync(RemoveClientCertificate options)
7675
taskCompletionSource.SetResult(null);
7776
});
7877

79-
BridgeConnector.Socket.Emit("webContents-session-clearAuthCache", Id, JObject.FromObject(options, _jsonSerializer), guid);
78+
BridgeConnector.Socket.Emit("webContents-session-clearAuthCache", Id, guid);
8079

8180
return taskCompletionSource.Task;
8281
}

ElectronNET.API/WindowManager.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ public Task<BrowserView> CreateBrowserViewAsync(BrowserViewConstructorOptions op
192192

193193
string browserViewId = id.ToString();
194194
BrowserView browserView = new BrowserView(int.Parse(browserViewId));
195-
browserView.Destroyed += (b) => _browserViews.Remove(b);
196195

197196
_browserViews.Add(browserView);
198197

ElectronNET.CLI/Commands/BuildCommand.cs

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

199199
Console.WriteLine($"Package Electron App for Platform {platformInfo.ElectronPackerPlatform}...");
200-
ProcessHelper.CmdExecute($"npx electron-builder --config=./bin/electron-builder.json --{platformInfo.ElectronPackerPlatform} --{electronArch} -c.electronVersion=9.2.0 {electronParams}", tempPath);
200+
ProcessHelper.CmdExecute($"npx electron-builder --config=./bin/electron-builder.json --{platformInfo.ElectronPackerPlatform} --{electronArch} -c.electronVersion=11.1.1 {electronParams}", tempPath);
201201

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

ElectronNET.Host/ElectronHostHook/connector.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ElectronNET.Host/ElectronHostHook/connector.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ElectronNET.Host/ElectronHostHook/index.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ElectronNET.Host/ElectronHostHook/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ElectronNET.Host/ElectronHostHook/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ export class HookService extends Connector {
1111
// execute your own JavaScript Host logic here
1212
}
1313
}
14-

ElectronNET.Host/ElectronHostHook/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Gregor Biswanger",
1414
"license": "MIT",
1515
"devDependencies": {
16-
"@types/socket.io": "^2.1.2",
17-
"typescript": "^3.4.5"
16+
"@types/socket.io": "^2.1.12",
17+
"typescript": "^4.1.3"
1818
}
1919
}

ElectronNET.Host/api/app.js

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ElectronNET.Host/api/app.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ElectronNET.Host/api/app.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -103,25 +103,13 @@ export = (socket: SocketIO.Socket, app: Electron.App) => {
103103

104104
socket.on('appSetAppLogsPath', (path) => {
105105
app.setAppLogsPath(path);
106-
});
106+
});
107107

108108
socket.on('appGetPath', (name) => {
109109
const path = app.getPath(name);
110110
electronSocket.emit('appGetPathCompleted', path);
111111
});
112112

113-
// const nativeImages = {};
114-
115-
// function addNativeImage(nativeImage: Electron.NativeImage) {
116-
117-
// if(Object.keys(nativeImages).length === 0) {
118-
// nativeImage['1'] = nativeImage;
119-
// } else {
120-
// let indexCount = Object.keys(nativeImages).length + 1;
121-
// nativeImage[indexCount] = nativeImage;
122-
// }
123-
// }
124-
125113
socket.on('appGetFileIcon', async (path, options) => {
126114
let error = {};
127115

@@ -222,7 +210,7 @@ export = (socket: SocketIO.Socket, app: Electron.App) => {
222210
const activityType = app.getCurrentActivityType();
223211
electronSocket.emit('appGetCurrentActivityTypeCompleted', activityType);
224212
});
225-
213+
226214
socket.on('appInvalidateCurrentActivity', () => {
227215
app.invalidateCurrentActivity();
228216
});
@@ -290,7 +278,7 @@ export = (socket: SocketIO.Socket, app: Electron.App) => {
290278

291279
socket.on('appSetAboutPanelOptions', (options) => {
292280
app.setAboutPanelOptions(options);
293-
});
281+
});
294282

295283
socket.on('appGetUserAgentFallback', () => {
296284
electronSocket.emit('appGetUserAgentFallbackCompleted', app.userAgentFallback);

ElectronNET.Host/api/autoUpdater.js

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)