Compare commits

..

100 Commits

Author SHA1 Message Date
Robert Muehsig
3dea16798b 9.31.2 2020-07-06 19:00:17 +02:00
Gregor Biswanger
bf8c7c8fa1 Update to Electron 9.0.5 2020-07-06 18:37:31 +02:00
Gregor Biswanger
06724f6eae Rollback to socket.io 2.2.0 2020-07-06 18:24:23 +02:00
Gregor Biswanger
83e579d44b Merge branch 'master' of https://github.com/ElectronNET/Electron.NET 2020-07-06 18:19:08 +02:00
Gregor Biswanger
ed67aa8072 Update Changelog 2020-07-06 18:19:02 +02:00
Gregor Biswanger
5e005499ef Merge pull request #435 from writzx/master
Enabled empty tray icon
2020-07-05 00:26:51 +02:00
Gregor Biswanger
975e4020dc Merge pull request #443 from rbaker26/master
Bug Fix, Fixed Publishing Issue ("Unknown argument: .")
2020-07-05 00:24:21 +02:00
Bob Baker
15ce35a7d9 removed extra . cause build failures 2020-07-03 23:19:19 -07:00
Writwick Das
de1637672a enabled empty tray icon
(fixes click event on macos)
2020-06-15 17:01:31 +02:00
Robert Muehsig
8f92d3986f 9.31.1 2020-06-12 23:27:53 +02:00
Gregor Biswanger
ca7414b8e6 Merge pull request #430 from freosc/master
HostHook.CallAsync should use TaskCompletionSource.SetException instead of throwing exception
2020-06-12 15:54:58 +02:00
Fre
37ae869dcb HostHook CallAsync 2020-06-12 13:32:26 +02:00
Gregor Biswanger
3420ee2de4 Update to Electron 9.0.3 build - Update Changelog for Electron.NET 9.31.1 2020-06-11 23:39:08 +02:00
Gregor Biswanger
0a76e951eb Merge branch 'master' of https://github.com/ElectronNET/Electron.NET 2020-06-11 23:14:13 +02:00
Gregor Biswanger
4db316eb15 Update to Electron 9.0.3 - Update Changelog 2020-06-11 23:14:02 +02:00
Gregor Biswanger
a867f23220 Merge pull request #429 from kdlslyv/master
Add BrowserWindow.GetNativeWindowHandle()
2020-06-11 23:10:16 +02:00
kdl
490440c23a Add BrowserWindow.GetNativeWindowHandle() 2020-06-11 22:45:18 +02:00
Fre V
519fb53c00 Merge pull request #2 from ElectronNET/master
merge with original
2020-06-08 09:20:41 +02:00
Fre V
12388541ab Merge pull request #1 from freosc/CookieHandling
Implementation for electronjs cookie handling
2020-06-08 09:09:14 +02:00
Gregor Biswanger
8c8115f3bd Update for Electron.NET 9.31.1 2020-06-03 00:26:10 +02:00
Gregor Biswanger
4286bc4f45 Update for Electron.NET 9.31.1 2020-06-03 00:24:07 +02:00
Gregor Biswanger
886f839482 Update for Electron.9.31.1 2020-06-03 00:20:21 +02:00
Gregor Biswanger
96abbd161c Merge branch 'master' of https://github.com/ElectronNET/Electron.NET 2020-06-03 00:14:01 +02:00
Gregor Biswanger
9baf1528ac Update for Electron.NET 9.31.1 2020-06-03 00:13:56 +02:00
Gregor Biswanger
380441c2c8 Merge pull request #425 from konstantingross/feature/Fix_Dock_API
Fix Dock API/ Electron 9.0.1 Update / ...
2020-06-02 23:47:12 +02:00
Konstantin Gross
a66375e37c Fix cannot find modules in ElectronHostHook 2020-06-02 23:41:19 +02:00
Konstantin Gross
606d00de5a Improvement debugging and testing new api calls (without install cli) 2020-06-02 23:40:21 +02:00
Konstantin Gross
b3266cd93f Electron 9.0.1 Update 2020-06-02 23:33:54 +02:00
Konstantin Gross
cb36e34dc3 Fix deployment dock.js 2020-06-02 23:33:14 +02:00
Gregor Biswanger
db7a5ff868 Merge branch 'master' of https://github.com/ElectronNET/Electron.NET 2020-06-02 22:04:40 +02:00
Gregor Biswanger
a030e3cbe7 update Electron.NET 9.31.1 2020-06-02 22:04:35 +02:00
Gregor Biswanger
b98c570b9d Merge pull request #423 from gustavo-lara-molina/powerMonitor
Power monitor - adding missing events
2020-06-02 22:04:03 +02:00
Gregor Biswanger
d106c6b193 Merge pull request #422 from konstantingross/feature/App_API_Enhancements
App API enhancements
2020-06-02 21:58:58 +02:00
Gustavo Lara Molina
c95bbe7ab2 Merge remote-tracking branch 'origin/master' into powerMonitor 2020-06-02 09:42:06 -05:00
Gustavo Lara Molina
258710bc52 removing PM methods with issues for this versión 2020-06-02 09:31:15 -05:00
Konstantin Gross
9ddb1b195e Removed dock methods from app API and moved to dock API 2020-06-01 01:59:40 +02:00
Konstantin Gross
eee84d214e App API:
* Summaries rewritten
* Added new parameters / Removed not supported parameters
* Added some new methods like appFocus(options), appHasSingleLock, etc.
2020-05-31 03:09:54 +02:00
Gregor Biswanger
1ab48350e1 Merge branch 'master' of https://github.com/ElectronNET/Electron.NET 2020-05-27 22:26:57 +02:00
Gregor Biswanger
874bc8eb94 Update for Electron.NET 9.31.1 2020-05-27 22:26:53 +02:00
Gregor Biswanger
7aa2268a81 Merge pull request #418 from konstantingross/master
Shell API adapted to Electron 9.0.0
2020-05-27 22:26:17 +02:00
Konstantin Gross
b08222bddc Updated NuGet Package version 2020-05-27 11:32:12 +02:00
Konstantin Gross
c5c822a028 Update Shell.cs 2020-05-27 01:06:31 +02:00
Konstantin Gross
ce4ef03636 Update ShortcutLinkOperation.cs 2020-05-27 01:04:28 +02:00
Konstantin Gross
641864b946 * Shell.OpenPath API fix for Electron 9.0.0
* Shell.OpenExternal API fix for Electron 9.0.0
* Shell.MoveItemToTrash API fix for Electron 9.0.0 and added new macOS parameter
* Shell.ReadShortcutLink API fix for Electron 9.0.0
* Summaries have been rewritten
2020-05-27 00:51:48 +02:00
Konstantin Gross
c6d67a9145 Log disconnect reason 2020-05-27 00:43:28 +02:00
Gregor Biswanger
fabd25a89e Merge branch 'master' of https://github.com/ElectronNET/Electron.NET 2020-05-26 22:03:30 +02:00
Gregor Biswanger
029b077602 manage the configuration environment with the electron.manifest.json 2020-05-26 22:03:05 +02:00
Konstantin Gross
0329530815 Shell.ShowItemInFolder API fix for Electron 9.0.0 2020-05-26 15:11:22 +02:00
Konstantin Gross
58ab180c94 Missing semicolon 2020-05-26 15:09:47 +02:00
Gregor Biswanger
a03dc1d195 Merge pull request #417 from konstantingross/master
Shell.OpenItem API fix for Electron 9.0.0
2020-05-25 21:43:06 +02:00
Konstantin Gross
76dcdc4137 Shell.OpenItem API fix for Electron 9.0.0 2020-05-25 17:31:27 +02:00
Gregor Biswanger
2b415e5b59 Merge branch 'master' of https://github.com/ElectronNET/Electron.NET 2020-05-25 14:53:41 +02:00
Gregor Biswanger
94055b985f Update for 9.31.1 2020-05-25 14:53:36 +02:00
Gregor Biswanger
596aa68c70 Merge pull request #416 from konstantingross/master
Add missing API call for SetProgressBar options
2020-05-25 14:50:51 +02:00
Konstantin Gross
485bce08d7 Add missing API call for SetProgressBar options 2020-05-25 11:24:29 +02:00
Gregor Biswanger
2ba49dbd6a Update for 9.31.1 2020-05-24 22:03:04 +02:00
Gregor Biswanger
39c3e92128 implement lazy App.Ready event 2020-05-24 22:00:32 +02:00
Gregor Biswanger
c552a04347 add App.Ready event 2020-05-24 18:50:35 +02:00
Gregor Biswanger
1541553ed1 Merge pull request #415 from konstantingross/feature/New_host_IsReady_property
New App.IsReady property
2020-05-24 13:34:51 +02:00
Konstantin Gross
52b850092c Context menu example modified 2020-05-24 02:52:27 +02:00
Konstantin Gross
cac9cfcec8 Add lifetime hosted service to detect fully started ASP.NET Core 2020-05-24 02:51:34 +02:00
Konstantin Gross
4ad39ba4c1 Removed double slash in args 2020-05-24 02:43:36 +02:00
Gregor Biswanger
95acbd5dea Update to the native Electron 9.0.0 - Update electron-updater 4.3.1 - Update Changelog 2020-05-23 12:17:53 +02:00
Gregor Biswanger
95f9a59431 Merge pull request #413 from freosc/CookieHandling
Implementation for electronjs cookie handling
2020-05-23 11:49:59 +02:00
Frederik Vermeersch
d409c3a0f9 Implementation for electronjs cookie handling 2020-05-22 16:38:34 +02:00
Gregor Biswanger
6d0fbde5ad set contectmenu on correct lifetime.. 2020-05-22 00:18:59 +02:00
Gregor Biswanger
b113532a86 update 8.31.3 infos 2020-05-21 23:04:55 +02:00
Gregor Biswanger
b043688f7f add workaround for #412 - update to socket.io 2.3.0 2020-05-21 22:58:17 +02:00
Gregor Biswanger
3b3e38f1bf update 8.31.3 infos 2020-05-21 22:41:27 +02:00
Gregor Biswanger
9502eb787a Fixed bug - #411 2020-05-21 22:39:52 +02:00
Gregor Biswanger
4a9b6fa9c1 Merge pull request #409 from konstantingross/feature/Add_missing_config_parameter_#407
Add missing config parameter fixes #407
2020-05-21 20:40:28 +02:00
Gregor Biswanger
fb308ed1c6 Merge pull request #410 from konstantingross/feature/NotificationOptions_fixes_#408
Added missing properties in Notifications
2020-05-21 13:29:43 +02:00
Konstantin Gross
d51a481e50 Added three missing propertys and fixing typos 2020-05-21 01:32:38 +02:00
Konstantin Gross
bb3d073fae Custom user path removed and replaced by the correct directory with VS macro 2020-05-20 19:02:15 +02:00
Konstantin Gross
8c250ae83e Add ConfigurationProfile paramter to electronize start command 2020-05-20 18:59:38 +02:00
Konstantin Gross
a5543bfe60 Typo in summary 2020-05-20 18:58:31 +02:00
Gregor Biswanger
c40affb32e Merge pull request #406 from Mandrakia/master
Added UserAgentFallback to App
2020-05-19 13:34:15 +02:00
Gregor Biswanger
e9331728b4 Merge branch 'master' into master 2020-05-19 13:34:04 +02:00
Gregor Biswanger
92b0388300 Merge pull request #405 from dafergu2/master
Update application exit logic
2020-05-19 13:19:47 +02:00
Gire Jean-Philippe
f4ea6df204 Added UserAgentFallback to App 2020-05-19 11:59:11 +02:00
Dave Ferguson
b027ca7c66 Exit net core backend on electron quit
This change explicitly cleans up the .net core http process when the
hosting electron application quits.  On macos, the child process was
sometimes left running depending on how the application was exited.

GH-346
2020-05-18 19:58:31 -04:00
Dave Ferguson
0573e92ed5 Fix logic of all windows closed event on macos
The application was not raising the all windows closed event which
didn't allow the .NET application to exit properly when the last window
was closed.

The recommendation by electronjs is to subscribe to the all windows
closed event and exit the app via code on macos.

This change allows the event to propagated up to the .NET application.

It may be better to move all of the logic surrounding this to the
ElectronNET.API project and allow the application developer full
control over the behavior.  For now, this fixes the immediate bug.

GH-346
2020-05-18 19:58:22 -04:00
Gregor Biswanger
672e3b86fd Merge pull request #402 from konstantingross/feature/Additional_NativeTheme_implementations
Remaining implementation of the NativeTheme API
2020-05-19 00:24:28 +02:00
Konstantin Gross
b7960eb772 PR fixes 2020-05-18 23:57:10 +02:00
Gustavo Lara
bbab114c54 Adding All PowerMonitor Methods, Fixing Comments 2020-05-18 16:14:03 -05:00
Konstantin Gross
e77f48b2c5 Fix formatting and summary 2020-05-18 21:01:47 +02:00
Gustavo Lara Molina
8fe60bfcda adding all powerMonitor api events 2020-05-17 22:16:31 -05:00
gustavo-lara-molina
09fa662ed1 Merge pull request #1 from ElectronNET/master
Updating fork
2020-05-17 20:44:15 -05:00
Konstantin Gross
7f2269c4bd Remaining implementation of the NativeTheme API: shouldUseHighContrastColors, shouldUseInvertedColorScheme, get/set themeSource and updated event 2020-05-17 02:54:01 +02:00
Gregor Biswanger
05de4071d1 Update 2020-05-15 00:18:38 +02:00
Gregor Biswanger
169abc2376 implement NativeTheme API with shouldUseDarkColors 2020-05-13 14:16:36 +02:00
Gregor Biswanger
12a3f2689e Update 8.31.3 2020-05-13 01:44:40 +02:00
Gregor Biswanger
14587463e7 add new powerMonitor API js file - fix formating 2020-05-13 01:41:09 +02:00
Gregor Biswanger
6690b4a76e Merge pull request #399 from gustavo-lara-molina/powerMonitor
Power monitor
2020-05-13 01:12:57 +02:00
Gustavo Lara Molina
c8e51ef21b Updating Comments 2020-05-12 10:50:08 -05:00
Gustavo Lara Molina
96a5189f14 Merge - from master 2020-05-12 10:11:04 -05:00
Gustavo Lara Molina
13fcedc3a0 Updating Labesl 2020-05-12 10:10:34 -05:00
Gustavo Lara Molina
c12c26b491 Merge branch 'master' of https://github.com/ElectronNET/Electron.NET 2020-05-12 09:12:22 -05:00
Robert Muehsig
6ddce85bdd 8.31.2 2020-05-12 01:00:31 +02:00
Rocket
df02855471 Added the API Power 2020-05-11 12:59:21 -05:00
94 changed files with 3475 additions and 1112 deletions

View File

@@ -1,5 +1,44 @@
# Not released
# Released
# 9.31.2
* Electron-Builder fixed for Windows builds.
# 9.31.1
ElectronNET.CLI:
* New Feature: Added config parameter (thanks [konstantingross](https://github.com/konstantingross)) [\#409](https://github.com/ElectronNET/Electron.NET/pull/409)
* New Feature: Set the configuration environment with the electron.manifest.json file.
* Fixed bug: Custom user path removed and replaced by the correct directory with VS macro (When ElectronNET.CLI is the Startup Project, press F5 (Debug) and the ElectronNET.WebApp starts correctly without error!) (thanks [konstantingross](https://github.com/konstantingross)) [\#409](https://github.com/ElectronNET/Electron.NET/pull/409)
ElectronNET.API:
* New Feature: Native Electron 9.0.3 support, but not all new features (we search contributors)
* New Feature: PowerMonitor API Support (thanks [gustavo-lara-molina](https://github.com/gustavo-lara-molina)) [\#399](https://github.com/ElectronNET/Electron.NET/pull/399) [\#423](https://github.com/ElectronNET/Electron.NET/pull/423)
* New Feature: NativeTheme API Support (thanks [konstantingross](https://github.com/konstantingross)) [\#402](https://github.com/ElectronNET/Electron.NET/pull/402)
* New Feature: Cookie API Support (thanks [freosc](https://github.com/freosc)) [\#413](https://github.com/ElectronNET/Electron.NET/pull/413)
* Changed Feature: Removed dock methods from App API and moved to Dock API (thanks [konstantingross](https://github.com/konstantingross)) [\#422](https://github.com/ElectronNET/Electron.NET/pull/422)
* App-Api Enhancement: MenuItems with Submenus need an submenu type workaround [\#412](https://github.com/ElectronNET/Electron.NET/issues/412)
* App-Api Enhancement: Added UserAgentFallback (thanks [Mandrakia](https://github.com/Mandrakia)) [\#406](https://github.com/ElectronNET/Electron.NET/pull/406)
* App-Api Enhancement: Summaries rewritten, new App.IsReady / App.HasSingleInstanceLock property, App.Ready event, App.Focus with force parameter method, many parameters changes (thanks [konstantingross](https://github.com/konstantingross)) [\#415](https://github.com/ElectronNET/Electron.NET/pull/415) [\#422](https://github.com/ElectronNET/Electron.NET/pull/422)
* App-Api Enhancement: New App.IsReady property and App.Ready event (thanks [konstantingross](https://github.com/konstantingross)) [\#415](https://github.com/ElectronNET/Electron.NET/pull/415)
* Shell-Api Enhancement: API fixes for Electron 9.0.0 / Added missing parameters / Summaries rewritten (thanks [konstantingross](https://github.com/konstantingross)) [\#417](https://github.com/ElectronNET/Electron.NET/pull/417) [\#418](https://github.com/ElectronNET/Electron.NET/pull/418)
* Notification-Api Enhancement: Added missing properties in Notifications (thanks [konstantingross](https://github.com/konstantingross)) [\#410](https://github.com/ElectronNET/Electron.NET/pull/410)
* BrowserWindows-Api Enhancement: Add missing API call for SetProgressBar options (thanks [konstantingross](https://github.com/konstantingross)) [\#416](https://github.com/ElectronNET/Electron.NET/pull/416)
* BrowserWindow Enhancement: Add BrowserWindow.GetNativeWindowHandle() (thanks [kdlslyv](https://github.com/kdlslyv)) [\#429](https://github.com/ElectronNET/Electron.NET/pull/429)
* HostHook-Api Enhancement: HostHook.CallAsync should use TaskCompletionSource.SetException instead of throwing exception (thanks [Fre V](https://github.com/freosc)) [\#430](https://github.com/ElectronNET/Electron.NET/pull/430)
* MacOS Enhancement: Application exit logic (thanks [dafergu2](https://github.com/dafergu2)) [\#405](https://github.com/ElectronNET/Electron.NET/pull/405)
* Fixed bug: ElectronNET.API.Entities.WebPreferences.ContextIsolation [DefaultValue(true)] [\#411](https://github.com/ElectronNET/Electron.NET/issues/411)
ElectronNET.WebApp (internal use):
* Improvement debugging and testing new API calls (without install ElectronNET.CLI) (thanks [konstantingross](https://github.com/konstantingross)) [\#425](https://github.com/ElectronNET/Electron.NET/pull/425)
* Fixed bug: Cannot find modules in ElectronHostHook (thanks [konstantingross](https://github.com/konstantingross)) [\#425](https://github.com/ElectronNET/Electron.NET/pull/425)
Thank you for donation [Phil Seeman](https://github.com/mpnow) ❤
# 8.31.2
ElectronNET.CLI:
@@ -15,8 +54,6 @@ ElectronNET.API:
* New Feature: Update menu items for context menu and system tray on-the-fly. [\#270](https://github.com/ElectronNET/Electron.NET/pull/270)
# Released
# 8.31.1
ElectronNET.CLI:

File diff suppressed because it is too large Load Diff

View File

@@ -1809,6 +1809,25 @@ namespace ElectronNET.API
return taskCompletionSource.Task;
}
/// <summary>
/// Returns the native type of the handle is HWND on Windows, NSView* on macOS, and Window (unsigned long) on Linux.
/// </summary>
/// <returns>string of the native handle obtained, HWND on Windows, NSView* on macOS, and Window (unsigned long) on Linux.</returns>
public Task<string> GetNativeWindowHandle()
{
var taskCompletionSource = new TaskCompletionSource<string>();
BridgeConnector.Socket.On("browserWindow-getNativeWindowHandle-completed", (nativeWindowHandle) =>
{
BridgeConnector.Socket.Off("browserWindow-getNativeWindowHandle-completed");
taskCompletionSource.SetResult(nativeWindowHandle.ToString());
});
BridgeConnector.Socket.Emit("browserWindowGetNativeWindowHandle", Id);
return taskCompletionSource.Task;
}
/// <summary>
/// Sets the pathname of the file the window represents,
/// and the icon of the file will show in windows title bar.

154
ElectronNET.API/Cookies.cs Normal file
View File

@@ -0,0 +1,154 @@
using System;
using System.Threading.Tasks;
using ElectronNET.API.Entities;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
namespace ElectronNET.API
{
/// <summary>
/// Query and modify a session's cookies.
/// </summary>
public class Cookies
{
/// <summary>
/// Gets the identifier.
/// </summary>
/// <value>
/// The identifier.
/// </value>
public int Id { get; private set; }
internal Cookies(int id)
{
Id = id;
}
/// <summary>
/// Emitted when a cookie is changed because it was added, edited, removed, or expired.
/// </summary>
public event Action<Cookie, CookieChangedCause, bool> OnChanged
{
add
{
if (_changed == null)
{
BridgeConnector.Socket.On("webContents-session-cookies-changed" + Id, (args) =>
{
Cookie cookie = ((JArray)args)[0].ToObject<Cookie>();
CookieChangedCause cause = ((JArray)args)[1].ToObject<CookieChangedCause>();
bool removed = ((JArray)args)[2].ToObject<bool>();
_changed(cookie, cause, removed);
});
BridgeConnector.Socket.Emit("register-webContents-session-cookies-changed", Id);
}
_changed += value;
}
remove
{
_changed -= value;
if (_changed == null)
BridgeConnector.Socket.Off("webContents-session-cookies-changed" + Id);
}
}
private event Action<Cookie, CookieChangedCause, bool> _changed;
/// <summary>
/// Sends a request to get all cookies matching filter, and resolves a callack with the response.
/// </summary>
/// <param name="filter">
/// </param>
/// <returns>A task which resolves an array of cookie objects.</returns>
public Task<Cookie[]> GetAsync(CookieFilter filter)
{
var taskCompletionSource = new TaskCompletionSource<Cookie[]>();
string guid = Guid.NewGuid().ToString();
BridgeConnector.Socket.On("webContents-session-cookies-get-completed" + guid, (cookies) =>
{
Cookie[] result = ((JArray)cookies).ToObject<Cookie[]>();
BridgeConnector.Socket.Off("webContents-session-cookies-get-completed" + guid);
taskCompletionSource.SetResult(result);
});
BridgeConnector.Socket.Emit("webContents-session-cookies-get", Id, JObject.FromObject(filter, _jsonSerializer), guid);
return taskCompletionSource.Task;
}
/// <summary>
///
/// </summary>
/// <param name="details"></param>
/// <returns></returns>
public Task SetAsync(CookieDetails details)
{
var taskCompletionSource = new TaskCompletionSource<object>();
string guid = Guid.NewGuid().ToString();
BridgeConnector.Socket.On("webContents-session-cookies-set-completed" + guid, () =>
{
BridgeConnector.Socket.Off("webContents-session-cookies-set-completed" + guid);
taskCompletionSource.SetResult(null);
});
BridgeConnector.Socket.Emit("webContents-session-cookies-set", Id, JObject.FromObject(details, _jsonSerializer), guid);
return taskCompletionSource.Task;
}
/// <summary>
/// Removes the cookies matching url and name
/// </summary>
/// <param name="url">The URL associated with the cookie.</param>
/// <param name="name">The name of cookie to remove.</param>
/// <returns>A task which resolves when the cookie has been removed</returns>
public Task RemoveAsync(string url, string name)
{
var taskCompletionSource = new TaskCompletionSource<object>();
string guid = Guid.NewGuid().ToString();
BridgeConnector.Socket.On("webContents-session-cookies-remove-completed" + guid, () =>
{
BridgeConnector.Socket.Off("webContents-session-cookies-remove-completed" + guid);
taskCompletionSource.SetResult(null);
});
BridgeConnector.Socket.Emit("webContents-session-cookies-remove", Id, url, name, guid);
return taskCompletionSource.Task;
}
/// <summary>
/// Writes any unwritten cookies data to disk.
/// </summary>
/// <returns>A task which resolves when the cookie store has been flushed</returns>
public Task FlushStoreAsync()
{
var taskCompletionSource = new TaskCompletionSource<object>();
string guid = Guid.NewGuid().ToString();
BridgeConnector.Socket.On("webContents-session-cookies-flushStore-completed" + guid, () =>
{
BridgeConnector.Socket.Off("webContents-session-cookies-flushStore-completed" + guid);
taskCompletionSource.SetResult(null);
});
BridgeConnector.Socket.Emit("webContents-session-cookies-flushStore", Id, guid);
return taskCompletionSource.Task;
}
private JsonSerializer _jsonSerializer = new JsonSerializer()
{
ContractResolver = new CamelCasePropertyNamesContractResolver(),
NullValueHandling = NullValueHandling.Ignore,
DefaultValueHandling = DefaultValueHandling.Ignore
};
}
}

206
ElectronNET.API/Dock.cs Normal file
View File

@@ -0,0 +1,206 @@
using System.Threading;
using System.Threading.Tasks;
using ElectronNET.API.Entities;
using ElectronNET.API.Extensions;
using Newtonsoft.Json.Linq;
namespace ElectronNET.API
{
/// <summary>
/// Control your app in the macOS dock.
/// </summary>
public sealed class Dock
{
private static Dock _dock;
private static object _syncRoot = new object();
internal Dock()
{
}
internal static Dock Instance
{
get
{
if (_dock == null)
{
lock (_syncRoot)
{
if (_dock == null)
{
_dock = new Dock();
}
}
}
return _dock;
}
}
/// <summary>
/// When <see cref="DockBounceType.Critical"/> is passed, the dock icon will bounce until either the application becomes
/// active or the request is canceled. When <see cref="DockBounceType.Informational"/> is passed, the dock icon will bounce
/// for one second. However, the request remains active until either the application becomes active or the request is canceled.
/// <para/>
/// Note: This method can only be used while the app is not focused; when the app is focused it will return -1.
/// </summary>
/// <param name="type">Can be critical or informational. The default is informational.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Return an ID representing the request.</returns>
public async Task<int> BounceAsync(DockBounceType type, CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
var taskCompletionSource = new TaskCompletionSource<int>();
using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled()))
{
BridgeConnector.Socket.On("dock-bounce-completed", (id) =>
{
BridgeConnector.Socket.Off("dock-bounce-completed");
taskCompletionSource.SetResult((int) id);
});
BridgeConnector.Socket.Emit("dock-bounce", type.GetDescription());
return await taskCompletionSource.Task
.ConfigureAwait(false);
}
}
/// <summary>
/// Cancel the bounce of id.
/// </summary>
/// <param name="id">Id of the request.</param>
public void CancelBounce(int id)
{
BridgeConnector.Socket.Emit("dock-cancelBounce", id);
}
/// <summary>
/// Bounces the Downloads stack if the filePath is inside the Downloads folder.
/// </summary>
/// <param name="filePath"></param>
public void DownloadFinished(string filePath)
{
BridgeConnector.Socket.Emit("dock-downloadFinished", filePath);
}
/// <summary>
/// Sets the string to be displayed in the docks badging area.
/// </summary>
/// <param name="text"></param>
public void SetBadge(string text)
{
BridgeConnector.Socket.Emit("dock-setBadge", text);
}
/// <summary>
/// Gets the string to be displayed in the docks badging area.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>The badge string of the dock.</returns>
public async Task<string> GetBadgeAsync(CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
var taskCompletionSource = new TaskCompletionSource<string>();
using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled()))
{
BridgeConnector.Socket.On("dock-getBadge-completed", (text) =>
{
BridgeConnector.Socket.Off("dock-getBadge-completed");
taskCompletionSource.SetResult((string) text);
});
BridgeConnector.Socket.Emit("dock-getBadge");
return await taskCompletionSource.Task
.ConfigureAwait(false);
}
}
/// <summary>
/// Hides the dock icon.
/// </summary>
public void Hide()
{
BridgeConnector.Socket.Emit("dock-hide");
}
/// <summary>
/// Shows the dock icon.
/// </summary>
public void Show()
{
BridgeConnector.Socket.Emit("dock-show");
}
/// <summary>
/// Whether the dock icon is visible. The app.dock.show() call is asynchronous
/// so this method might not return true immediately after that call.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Whether the dock icon is visible.</returns>
public async Task<bool> IsVisibleAsync(CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
var taskCompletionSource = new TaskCompletionSource<bool>();
using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled()))
{
BridgeConnector.Socket.On("dock-isVisible-completed", (isVisible) =>
{
BridgeConnector.Socket.Off("dock-isVisible-completed");
taskCompletionSource.SetResult((bool) isVisible);
});
BridgeConnector.Socket.Emit("dock-isVisible");
return await taskCompletionSource.Task
.ConfigureAwait(false);
}
}
/// <summary>
/// TODO: Menu (macOS) still to be implemented
/// Sets the application's dock menu.
/// </summary>
public void SetMenu()
{
BridgeConnector.Socket.Emit("dock-setMenu");
}
/// <summary>
/// TODO: Menu (macOS) still to be implemented
/// Gets the application's dock menu.
/// </summary>
public async Task<Menu> GetMenu(CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
var taskCompletionSource = new TaskCompletionSource<Menu>();
using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled()))
{
BridgeConnector.Socket.On("dock-getMenu-completed", (menu) =>
{
BridgeConnector.Socket.Off("dock-getMenu-completed");
taskCompletionSource.SetResult(((JObject)menu).ToObject<Menu>());
});
BridgeConnector.Socket.Emit("dock-getMenu");
return await taskCompletionSource.Task
.ConfigureAwait(false);
}
}
/// <summary>
/// Sets the image associated with this dock icon.
/// </summary>
/// <param name="image"></param>
public void SetIcon(string image)
{
BridgeConnector.Socket.Emit("dock-setIcon", image);
}
}
}

View File

@@ -73,5 +73,20 @@
/// <c>electronize add HostHook</c>
/// </summary>
public static HostHook HostHook { get { return HostHook.Instance; } }
/// <summary>
/// Allows you to execute native Lock and Unlock process.
/// </summary>
public static PowerMonitor PowerMonitor { get { return PowerMonitor.Instance; } }
/// <summary>
/// Read and respond to changes in Chromium's native color theme.
/// </summary>
public static NativeTheme NativeTheme { get { return NativeTheme.Instance; } }
/// <summary>
/// Control your app in the macOS dock.
/// </summary>
public static Dock Dock { get { return Dock.Instance; } }
}
}
}

View File

@@ -1,7 +1,7 @@
namespace ElectronNET.API.Entities
{
/// <summary>
///
/// About panel options.
/// </summary>
public class AboutPanelOptions
{
@@ -20,14 +20,29 @@
/// </summary>
public string Copyright { get; set; }
/// <summary>
/// The app's build version number.
/// </summary>
public string Version { get; set; }
/// <summary>
/// Credit information.
/// </summary>
public string Credits { get; set; }
/// <summary>
/// The app's build version number.
/// List of app authors.
/// </summary>
public string Version { get; set; }
public string[] Authors { get; set; }
/// <summary>
/// The app's website.
/// </summary>
public string Website { get; set; }
/// <summary>
/// Path to the app's icon. On Linux, will be shown as 64x64 pixels while retaining aspect ratio.
/// </summary>
public string IconPath { get; set; }
}
}

View File

@@ -5,15 +5,15 @@
/// </summary>
public class CPUUsage
{
/// <summary>
/// Percentage of CPU used since the last call to getCPUUsage. First call returns 0.
/// </summary>
public int PercentCPUUsage { get; set; }
/// <summary>
/// The number of average idle cpu wakeups per second since the last call to
/// getCPUUsage.First call returns 0.
/// </summary>
public int IdleWakeupsPerSecond { get; set; }
/// <summary>
/// Percentage of CPU used since the last call to getCPUUsage. First call returns 0.
/// </summary>
public int PercentCPUUsage { get; set; }
}
}

View File

@@ -0,0 +1,51 @@
namespace ElectronNET.API.Entities {
/// <summary>
///
/// </summary>
public class Cookie {
/// <summary>
/// The name of the cookie.
/// </summary>
public string Name { get; set;}
/// <summary>
/// The value of the cookie.
/// </summary>
public string Value { get; set; }
/// <summary>
/// (optional) - The domain of the cookie; this will be normalized with a preceding dot so that it's also valid for subdomains.
/// </summary>
public string Domain { get; set; }
/// <summary>
/// (optional) - Whether the cookie is a host-only cookie; this will only be true if no domain was passed.
/// </summary>
public bool HostOnly { get; set; }
/// <summary>
/// (optional) - The path of the cookie.
/// </summary>
public string Path { get; set; }
/// <summary>
/// (optional) - Whether the cookie is marked as secure.
/// </summary>
public bool Secure { get; set; }
/// <summary>
/// (optional) - Whether the cookie is marked as HTTP only.
/// </summary>
public bool HttpOnly { get; set; }
/// <summary>
/// (optional) - Whether the cookie is a session cookie or a persistent cookie with an expiration date.
/// </summary>
public bool Session { get; set; }
/// <summary>
/// (optional) - The expiration date of the cookie as the number of seconds since the UNIX epoch. Not provided for session cookies.
/// </summary>
public long ExpirationDate { get; set; }
}
}

View File

@@ -0,0 +1,38 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace ElectronNET.API.Entities {
/// <summary>
/// The cause of the change
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum CookieChangedCause
{
/// <summary>
///The cookie was changed directly by a consumer's action.
/// </summary>
[JsonProperty("explicit")]
@explicit,
/// <summary>
/// The cookie was automatically removed due to an insert operation that overwrote it.
/// </summary>
overwrite,
/// <summary>
/// The cookie was automatically removed as it expired.
/// </summary>
expired,
/// <summary>
/// The cookie was automatically evicted during garbage collection.
/// </summary>
evicted,
/// <summary>
/// The cookie was overwritten with an already-expired expiration date.
/// </summary>
[JsonProperty("expired_overwrite")]
expiredOverwrite
}
}

View File

@@ -0,0 +1,56 @@
using System.ComponentModel;
namespace ElectronNET.API.Entities {
/// <summary>
///
/// </summary>
public class CookieDetails {
/// <summary>
/// The URL to associate the cookie with. The callback will be rejected if the URL is invalid.
/// </summary>
public string Url { get; set; }
/// <summary>
/// (optional) - The name of the cookie. Empty by default if omitted.
/// </summary>
[DefaultValue("")]
public string Name { get; set; }
/// <summary>
/// (optional) - The value of the cookie. Empty by default if omitted.
/// </summary>
[DefaultValue("")]
public string Value { get; set; }
/// <summary>
/// (optional) - The domain of the cookie; this will be normalized with a preceding dot so that it's also valid for subdomains. Empty by default if omitted.
/// </summary>
[DefaultValue("")]
public string Domain { get; set; }
/// <summary>
/// (optional) - The path of the cookie. Empty by default if omitted.
/// </summary>
[DefaultValue("")]
public string Path { get; set; }
/// <summary>
/// (optional) - Whether the cookie is marked as secure. Defaults to false.
/// </summary>
[DefaultValue(false)]
public bool Secure { get; set; }
/// <summary>
/// (optional) - Whether the cookie is marked as HTTP only. Defaults to false.
/// </summary>
[DefaultValue(false)]
public bool HttpOnly { get; set; }
/// <summary>
/// (optional) - The expiration date of the cookie as the number of seconds since the UNIX epoch.
/// If omitted then the cookie becomes a session cookie and will not be retained between sessions.
/// </summary>
[DefaultValue(0)]
public long ExpirationDate { get; set; }
}
}

View File

@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace ElectronNET.API.Entities
{
/// <summary>
///
/// </summary>
public class CookieFilter
{
/// <summary>
/// (optional) - Retrieves cookies which are associated with url.Empty implies retrieving cookies of all URLs.
/// </summary>
public string Url { get; set; }
/// <summary>
/// (optional) - Filters cookies by name.
/// </summary>
public string Name { get; set; }
/// <summary>
/// (optional) - Retrieves cookies whose domains match or are subdomains of domains.
/// </summary>
public string Domain { get; set; }
/// <summary>
/// (optional) - Retrieves cookies whose path matches path.
/// </summary>
public string Path { get; set; }
/// <summary>
/// (optional) - Filters cookies by their Secure property.
/// </summary>
public bool Secure { get; set; }
/// <summary>
/// (optional) - Filters out session or persistent cookies.
/// </summary>
public bool Session { get; set; }
}
}

View File

@@ -1,18 +1,22 @@
namespace ElectronNET.API
using System.ComponentModel;
namespace ElectronNET.API.Entities
{
/// <summary>
///
/// Defines the DockBounceType enumeration.
/// </summary>
public enum DockBounceType
{
/// <summary>
/// The critical
/// Dock icon will bounce until either the application becomes active or the request is canceled.
/// </summary>
critical,
[Description("critical")]
Critical,
/// <summary>
/// The informational
/// The dock icon will bounce for one second.
/// </summary>
informational
[Description("informational")]
Informational
}
}

View File

@@ -1,16 +0,0 @@
namespace ElectronNET.API.Entities
{
/// <summary>
///
/// </summary>
public class Error
{
/// <summary>
/// Gets or sets the stack.
/// </summary>
/// <value>
/// The stack.
/// </value>
public string Stack { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
namespace ElectronNET.API.Entities
{
/// <summary>
/// Controls the behavior of <see cref="App.Focus(FocusOptions)"/>.
/// </summary>
public class FocusOptions
{
/// <summary>
/// Make the receiver the active app even if another app is currently active.
/// <para/>
/// You should seek to use the <see cref="Steal"/> option as sparingly as possible.
/// </summary>
public bool Steal { get; set; }
}
}

View File

@@ -8,77 +8,77 @@ namespace ElectronNET.API.Entities
public class GPUFeatureStatus
{
/// <summary>
/// Canvas
/// Canvas.
/// </summary>
[JsonProperty("2d_canvas")]
public string Canvas { get; set; }
/// <summary>
/// Flash
/// Flash.
/// </summary>
[JsonProperty("flash_3d")]
public string Flash3D { get; set; }
/// <summary>
/// Flash Stage3D
/// Flash Stage3D.
/// </summary>
[JsonProperty("flash_stage3d")]
public string FlashStage3D { get; set; }
/// <summary>
/// Flash Stage3D Baseline profile
/// Flash Stage3D Baseline profile.
/// </summary>
[JsonProperty("flash_stage3d_baseline")]
public string FlashStage3dBaseline { get; set; }
/// <summary>
/// Compositing
/// Compositing.
/// </summary>
[JsonProperty("gpu_compositing")]
public string GpuCompositing { get; set; }
/// <summary>
/// Multiple Raster Threads
/// Multiple Raster Threads.
/// </summary>
[JsonProperty("multiple_raster_threads")]
public string MultipleRasterThreads { get; set; }
/// <summary>
/// Native GpuMemoryBuffers
/// Native GpuMemoryBuffers.
/// </summary>
[JsonProperty("native_gpu_memory_buffers")]
public string NativeGpuMemoryBuffers { get; set; }
/// <summary>
/// Rasterization
/// Rasterization.
/// </summary>
public string Rasterization { get; set; }
/// <summary>
/// Video Decode
/// Video Decode.
/// </summary>
[JsonProperty("video_decode")]
public string VideoDecode { get; set; }
/// <summary>
/// Video Encode
/// Video Encode.
/// </summary>
[JsonProperty("video_encode")]
public string VideoEncode { get; set; }
/// <summary>
/// VPx Video Decode
/// VPx Video Decode.
/// </summary>
[JsonProperty("vpx_decode")]
public string VpxDecode { get; set; }
/// <summary>
/// WebGL
/// WebGL.
/// </summary>
public string Webgl { get; set; }
/// <summary>
/// WebGL2
/// WebGL2.
/// </summary>
public string Webgl2 { get; set; }
}

View File

@@ -1,8 +1,7 @@
using ElectronNET.API.Entities;
using Newtonsoft.Json;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace ElectronNET.API
namespace ElectronNET.API.Entities
{
/// <summary>
///
@@ -25,4 +24,4 @@ namespace ElectronNET.API
[JsonConverter(typeof(StringEnumConverter))]
public JumpListCategoryType Type { get; set; }
}
}
}

View File

@@ -1,4 +1,4 @@
namespace ElectronNET.API
namespace ElectronNET.API.Entities
{
/// <summary>
///

View File

@@ -6,13 +6,16 @@
public class JumpListSettings
{
/// <summary>
/// The minimum number of items that will be shown in the Jump List (for a more detailed description of this value see the MSDN docs).
/// The minimum number of items that will be shown in the Jump List (for a more detailed description of this value see the
/// <see href="https://msdn.microsoft.com/en-us/library/windows/desktop/dd378398(v=vs.85).aspx">MSDN</see> docs).
/// </summary>
public int MinItems { get; set; } = 0;
/// <summary>
/// Array of JumpListItem objects that correspond to items that the user has explicitly removed from custom categories in the Jump List. These items must not be re-added to the Jump List in the next call to app.setJumpList(), Windows will not display any custom category that contains any of the removed items.
/// Array of JumpListItem objects that correspond to items that the user has explicitly removed from custom categories
/// in the Jump List. These items must not be re-added to the Jump List in the next call to <see cref="App.SetJumpList"/>, Windows will
/// not display any custom category that contains any of the removed items.
/// </summary>
public JumpListItem[] RemovedItems { get; set; } = new JumpListItem[0];
}
}
}

View File

@@ -6,33 +6,33 @@
public class LoginItemSettings
{
/// <summary>
/// true if the app is set to open at login.
/// <see langword="true"/> if the app is set to open at login.
/// </summary>
public bool OpenAtLogin { get; set; }
/// <summary>
/// true if the app is set to open as hidden at login. This setting is only
/// supported on macOS.
/// <see langword="true"/> if the app is set to open as hidden at login. This setting is not available
/// on <see href="https://www.electronjs.org/docs/tutorial/mac-app-store-submission-guide">MAS builds</see>.
/// </summary>
public bool OpenAsHidden { get; set; }
/// <summary>
/// true if the app was opened at login automatically. This setting is only
/// supported on macOS.
/// <see langword="true"/> if the app was opened at login automatically. This setting is not available
/// on <see href="https://www.electronjs.org/docs/tutorial/mac-app-store-submission-guide">MAS builds</see>.
/// </summary>
public bool WasOpenedAtLogin { get; set; }
/// <summary>
/// true if the app was opened as a hidden login item. This indicates that the app
/// should not open any windows at startup.This setting is only supported on macOS.
/// <see langword="true"/> if the app was opened as a hidden login item. This indicates that the app should not
/// open any windows at startup. This setting is not available on
/// <see href="https://www.electronjs.org/docs/tutorial/mac-app-store-submission-guide">MAS builds</see>.
/// </summary>
public bool WasOpenedAsHidden { get; set; }
/// <summary>
/// true if the app was opened as a login item that should restore the state from
/// the previous session.This indicates that the app should restore the windows
/// that were open the last time the app was closed.This setting is only supported
/// on macOS.
/// <see langword="true"/> if the app was opened as a login item that should restore the state from the previous
/// session. This indicates that the app should restore the windows that were open the last time the app was closed.
/// This setting is not available on <see href="https://www.electronjs.org/docs/tutorial/mac-app-store-submission-guide">MAS builds</see>.
/// </summary>
public bool RestoreState { get; set; }
}

View File

@@ -6,16 +6,15 @@
public class LoginSettings
{
/// <summary>
/// true to open the app at login, false to remove the app as a login item. Defaults
/// to false.
/// <see langword="true"/> to open the app at login, <see langword="false"/> to remove the app as a login item.
/// Defaults to <see langword="false"/>.
/// </summary>
public bool OpenAtLogin { get; set; }
/// <summary>
/// true to open the app as hidden. Defaults to false. The user can edit this
/// setting from the System Preferences so
/// app.getLoginItemStatus().wasOpenedAsHidden should be checked when the app is
/// opened to know the current value.This setting is only supported on macOS.
/// <see langword="true"/> to open the app as hidden. Defaults to <see langword="false"/>. The user can edit this
/// setting from the System Preferences so app.getLoginItemSettings().wasOpenedAsHidden should be checked when the app is
/// opened to know the current value. This setting is not available on <see href="https://www.electronjs.org/docs/tutorial/mac-app-store-submission-guide">MAS builds</see>.
/// </summary>
public bool OpenAsHidden { get; set; }

View File

@@ -6,31 +6,19 @@
public class MemoryInfo
{
/// <summary>
/// The maximum amount of memory that has ever been pinned to actual physical RAM.
/// On macOS its value will always be 0.
/// The amount of memory currently pinned to actual physical RAM.
/// </summary>
public int PeakWorkingSetSize { get; set; }
public int WorkingSetSize { get; set; }
/// <summary>
/// Process id of the process.
/// The maximum amount of memory that has ever been pinned to actual physical RAM.
/// </summary>
public int Pid { get; set; }
public int PeakWorkingSetSize { get; set; }
/// <summary>
/// The amount of memory not shared by other processes, such as JS heap or HTML
/// content.
/// </summary>
public int PrivateBytes { get; set; }
/// <summary>
/// The amount of memory shared between processes, typically memory consumed by the
/// Electron code itself
/// </summary>
public int SharedBytes { get; set; }
/// <summary>
/// The amount of memory currently pinned to actual physical RAM.
/// </summary>
public int WorkingSetSize {get; set; }
}
}
}

View File

@@ -10,28 +10,28 @@ namespace ElectronNET.API.Entities
{
/// <summary>
/// A title for the notification, which will be shown at the top of the notification
/// window when it is shown
/// window when it is shown.
/// </summary>
public string Title { get; set; }
/// <summary>
/// A subtitle for the notification, which will be displayed below the title.
/// </summary>
public string SubTitle { get; set; }
/// <summary>
/// The body text of the notification, which will be displayed below the title or
/// subtitle
/// subtitle.
/// </summary>
public string Body { get; set; }
/// <summary>
/// A subtitle for the notification, which will be displayed below the title.
/// </summary>
public string Subtitle { get; set; }
/// <summary>
/// Whether or not to emit an OS notification noise when showing the notification
/// Whether or not to emit an OS notification noise when showing the notification.
/// </summary>
public bool Silent { get; set; }
/// <summary>
/// An icon to use in the notification
/// An icon to use in the notification.
/// </summary>
public string Icon { get; set; }
@@ -40,6 +40,11 @@ namespace ElectronNET.API.Entities
/// </summary>
public bool HasReply { get; set; }
/// <summary>
/// The timeout duration of the notification. Can be 'default' or 'never'.
/// </summary>
public string TimeoutType { get; set; }
/// <summary>
/// The placeholder to write in the inline reply input field.
/// </summary>
@@ -50,16 +55,27 @@ namespace ElectronNET.API.Entities
/// </summary>
public string Sound { get; set; }
/// <summary>
/// The urgency level of the notification. Can be 'normal', 'critical', or 'low'.
/// </summary>
public string Urgency { get; set; }
/// <summary>
/// Actions to add to the notification. Please read the available actions and
/// limitations in the NotificationAction documentation
/// limitations in the NotificationAction documentation.
/// </summary>
public NotificationAction Actions { get; set; }
/// <summary>
/// Emitted when the notification is shown to the user,
/// note this could be fired multiple times as a notification
/// can be shown multiple times through the Show() method.
/// A custom title for the close button of an alert. An empty string will cause the
/// default localized text to be used.
/// </summary>
public string CloseButtonText { get; set; }
/// <summary>
/// Emitted when the notification is shown to the user, note this could be fired
/// multiple times as a notification can be shown multiple times through the Show()
/// method.
/// </summary>
[JsonIgnore]
public Action OnShow { get; set; }
@@ -148,4 +164,4 @@ namespace ElectronNET.API.Entities
Body = body;
}
}
}
}

View File

@@ -1,16 +1,22 @@
using System.ComponentModel;
using System;
using System.ComponentModel;
namespace ElectronNET.API.Entities
{
/// <summary>
///
/// Controls the behavior of OpenExternal.
/// </summary>
public class OpenExternalOptions
{
/// <summary>
/// true to bring the opened application to the foreground. The default is true.
/// <see langword="true"/> to bring the opened application to the foreground. The default is <see langword="true"/>.
/// </summary>
[DefaultValue(true)]
public bool Activate { get; set; } = true;
/// <summary>
/// The working directory.
/// </summary>
public string WorkingDirectory { get; set; }
}
}

View File

@@ -1,79 +1,95 @@
namespace ElectronNET.API.Entities
using System.ComponentModel;
namespace ElectronNET.API.Entities
{
/// <summary>
///
/// Defines the PathName enumeration.
/// </summary>
public enum PathName
{
/// <summary>
/// Users home directory.
/// </summary>
home,
[Description("home")]
Home,
/// <summary>
/// Per-user application data directory.
/// </summary>
appData,
[Description("appData")]
AppData,
/// <summary>
/// The directory for storing your apps configuration files,
/// which by default it is the appData directory appended with your apps name.
/// </summary>
userData,
[Description("userData")]
UserData,
/// <summary>
/// Temporary directory.
/// </summary>
temp,
[Description("temp")]
Temp,
/// <summary>
/// The current executable file.
/// </summary>
exe,
[Description("exe")]
Exe,
/// <summary>
/// The libchromiumcontent library.
/// </summary>
module,
[Description("Module")]
Module,
/// <summary>
/// The current users Desktop directory.
/// </summary>
desktop,
[Description("desktop")]
Desktop,
/// <summary>
/// Directory for a users “My Documents”.
/// </summary>
documents,
[Description("documents")]
Documents,
/// <summary>
/// Directory for a users downloads.
/// </summary>
downloads,
[Description("downloads")]
Downloads,
/// <summary>
/// Directory for a users music.
/// </summary>
music,
[Description("music")]
Music,
/// <summary>
/// Directory for a users pictures.
/// </summary>
pictures,
[Description("pictures")]
Pictures,
/// <summary>
/// Directory for a users videos.
/// </summary>
videos,
[Description("videos")]
Videos,
/// <summary>
/// The logs
/// The logs.
/// </summary>
logs,
[Description("logs")]
Logs,
/// <summary>
/// Full path to the system version of the Pepper Flash plugin.
/// </summary>
pepperFlashSystemPlugin
[Description("PepperFlashSystemPlugin")]
PepperFlashSystemPlugin
}
}

View File

@@ -5,24 +5,42 @@
/// </summary>
public class ProcessMetric
{
/// <summary>
/// CPU usage of the process.
/// </summary>
public CPUUsage Cpu { get; set; }
/// <summary>
/// Process id of the process.
/// </summary>
public int PId { get; set; }
/// <summary>
/// Memory information for the process.
/// </summary>
public MemoryInfo Memory {get; set;}
/// <summary>
/// Process type (Browser or Tab or GPU etc).
/// </summary>
public string Type { get; set; }
/// <summary>
/// Process id of the process.
/// </summary>
public int Pid { get; set; }
/// <summary>
/// CPU usage of the process.
/// </summary>
public CPUUsage Cpu { get; set; }
/// <summary>
/// Process type (Browser or Tab or GPU etc).
/// </summary>
public string Type { get; set; }
/// <summary>
/// Creation time for this process. The time is represented as number of milliseconds since epoch.
/// Since the <see cref="PId"/> can be reused after a process dies, it is useful to use both the <see cref="PId"/>
/// and the <see cref="CreationTime"/> to uniquely identify a process.
/// </summary>
public int CreationTime { get; set; }
/// <summary>
/// Memory information for the process.
/// </summary>
public MemoryInfo Memory { get; set; }
/// <summary>
/// Whether the process is sandboxed on OS level.
/// </summary>
public bool Sandboxed { get; set; }
/// <summary>
/// One of the following values:
/// untrusted | low | medium | high | unknown
/// </summary>
public string IntegrityLevel { get; set; }
}
}
}

View File

@@ -1,7 +1,7 @@
namespace ElectronNET.API.Entities
{
/// <summary>
///
/// Controls the behavior of <see cref="App.Relaunch(RelaunchOptions)"/>.
/// </summary>
public class RelaunchOptions
{
@@ -21,4 +21,4 @@
/// </value>
public string ExecPath { get; set; }
}
}
}

View File

@@ -1,38 +1,38 @@
namespace ElectronNET.API
namespace ElectronNET.API.Entities
{
/// <summary>
///
/// Structure of a shortcut.
/// </summary>
public class ShortcutDetails
{
/// <summary>
/// The Application User Model ID. Default is empty.
/// The Application User Model ID. Default is <see cref="string.Empty"/>.
/// </summary>
public string AppUserModelId { get; set; }
/// <summary>
/// The arguments to be applied to target when launching from this shortcut. Default is empty.
/// The arguments to be applied to <see cref="Target"/> when launching from this shortcut. Default is <see cref="string.Empty"/>.
/// </summary>
public string Args { get; set; }
/// <summary>
/// The working directory. Default is empty.
/// The working directory. Default is <see cref="string.Empty"/>.
/// </summary>
public string Cwd { get; set; }
/// <summary>
/// The description of the shortcut. Default is empty.
/// The description of the shortcut. Default is <see cref="string.Empty"/>.
/// </summary>
public string Description { get; set; }
/// <summary>
/// The path to the icon, can be a DLL or EXE. icon and iconIndex have to be set
/// together.Default is empty, which uses the target's icon.
/// The path to the icon, can be a DLL or EXE. <see cref="Icon"/> and <see cref="IconIndex"/> have to be set
/// together. Default is <see cref="string.Empty"/>, which uses the target's icon.
/// </summary>
public string Icon { get; set; }
/// <summary>
/// The resource ID of icon when icon is a DLL or EXE. Default is 0.
/// The resource ID of icon when <see cref="Icon"/> is a DLL or EXE. Default is 0.
/// </summary>
public int IconIndex { get; set; }

View File

@@ -1,23 +1,28 @@
namespace ElectronNET.API
using System.ComponentModel;
namespace ElectronNET.API.Entities
{
/// <summary>
///
/// Defines the ShortcutLinkOperation enumeration.
/// </summary>
public enum ShortcutLinkOperation
{
/// <summary>
/// Creates a new shortcut, overwriting if necessary.
/// </summary>
create,
[Description("create")]
Create,
/// <summary>
/// Updates specified properties only on an existing shortcut.
/// </summary>
update,
[Description("update")]
Update,
/// <summary>
/// Overwrites an existing shortcut, fails if the shortcut doesnt exist.
/// Overwrites an existing shortcut, fails if the shortcut doesn't exist.
/// </summary>
replace
[Description("replace")]
Replace
}
}
}

View File

@@ -0,0 +1,28 @@
using System.ComponentModel;
namespace ElectronNET.API.Entities
{
/// <summary>
/// Defines the ThemeSourceMode enumeration.
/// </summary>
public enum ThemeSourceMode
{
/// <summary>
/// Operating system default.
/// </summary>
[Description("system")]
System,
/// <summary>
/// Light theme.
/// </summary>
[Description("light")]
Light,
/// <summary>
/// Dark theme.
/// </summary>
[Description("dark")]
Dark
}
}

View File

@@ -52,5 +52,10 @@
/// The title.
/// </value>
public string Title { get; set; }
/// <summary>
/// The working directory. Default is <see cref="string.Empty"/>.
/// </summary>
public string WorkingDirectory { get; set; }
}
}
}

View File

@@ -173,7 +173,7 @@ namespace ElectronNET.API.Entities
/// <summary>
/// Whether to run Electron APIs and the specified preload script in a separate
/// JavaScript context.Defaults to false. The context that the preload script runs
/// JavaScript context. Defaults to false. The context that the preload script runs
/// in will still have full access to the document and window globals but it will
/// use its own set of JavaScript builtins (Array, Object, JSON, etc.) and will be
/// isolated from any changes made to the global environment by the loaded page.The
@@ -185,8 +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>
[DefaultValue(true)]
public bool ContextIsolation { get; set; } = true;
[DefaultValue(false)]
public bool ContextIsolation { get; set; }
/// <summary>
/// Whether to use native window.open(). Defaults to false. This option is currently experimental.

View File

@@ -48,5 +48,24 @@ namespace ElectronNET.API.Extensions
return result;
}
public static MenuItem[] AddSubmenuTypes(this MenuItem[] menuItems)
{
for (int index = 0; index < menuItems.Length; index++)
{
var menuItem = menuItems[index];
if (menuItem?.Submenu?.Length > 0)
{
if(menuItem.Type == MenuType.normal)
{
menuItem.Type = MenuType.submenu;
}
AddSubmenuTypes(menuItem.Submenu);
}
}
return menuItems;
}
}
}

View File

@@ -72,13 +72,14 @@ namespace ElectronNET.API
{
BridgeConnector.Socket.Off(socketEventName + "Error" + guid);
Electron.Dialog.ShowErrorBox("Host Hook Exception", result.ToString());
taskCompletionSource.SetException(new Exception($"Host Hook Exception {result}"));
});
BridgeConnector.Socket.On(socketEventName + "Complete" + guid, (result) =>
{
BridgeConnector.Socket.Off(socketEventName + "Error" + guid);
BridgeConnector.Socket.Off(socketEventName + "Complete" + guid);
T data;
T data = default;
try
{
@@ -105,7 +106,8 @@ namespace ElectronNET.API
}
catch (Exception exception)
{
throw new InvalidCastException("Return value does not match with the generic type.", exception);
taskCompletionSource.SetException(exception);
//throw new InvalidCastException("Return value does not match with the generic type.", exception);
}
taskCompletionSource.SetResult(data);

View File

@@ -0,0 +1,41 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
namespace ElectronNET.API
{
/// <summary>
/// Base class that reports if ASP.NET Core has fully started.
/// </summary>
internal class LifetimeServiceHost : IHostedService
{
public LifetimeServiceHost(IHostApplicationLifetime lifetime)
{
lifetime.ApplicationStarted.Register(() =>
{
App.Instance.IsReady = true;
Console.WriteLine("ASP.NET Core host has fully started.");
});
}
/// <summary>
/// Triggered when the application host is ready to start the service.
/// </summary>
/// <param name="cancellationToken">Indicates that the start process has been aborted.</param>
public Task StartAsync(CancellationToken cancellationToken)
{
return Task.CompletedTask;
}
/// <summary>
/// Triggered when the application host is performing a graceful shutdown.
/// </summary>
/// <param name="cancellationToken">Indicates that the shutdown process should no longer be graceful.</param>
public Task StopAsync(CancellationToken cancellationToken)
{
return Task.CompletedTask;
}
}
}

View File

@@ -56,6 +56,8 @@ namespace ElectronNET.API
_menuItems.Clear();
menuItems.AddMenuItemsId();
menuItems.AddSubmenuTypes();
BridgeConnector.Socket.Emit("menu-setApplicationMenu", JArray.FromObject(menuItems, _jsonSerializer));
_menuItems.AddRange(menuItems);
@@ -83,6 +85,8 @@ namespace ElectronNET.API
public void SetContextMenu(BrowserWindow browserWindow, MenuItem[] menuItems)
{
menuItems.AddMenuItemsId();
menuItems.AddSubmenuTypes();
BridgeConnector.Socket.Emit("menu-setContextMenu", browserWindow.Id, JArray.FromObject(menuItems, _jsonSerializer));
if (!_contextMenuItems.ContainsKey(browserWindow.Id))

View File

@@ -0,0 +1,212 @@
using System;
using System.Threading.Tasks;
using ElectronNET.API.Entities;
using ElectronNET.API.Extensions;
namespace ElectronNET.API
{
/// <summary>
/// Read and respond to changes in Chromium's native color theme.
/// </summary>
public sealed class NativeTheme
{
private static NativeTheme _nativeTheme;
private static object _syncRoot = new object();
internal NativeTheme() { }
internal static NativeTheme Instance
{
get
{
if (_nativeTheme == null)
{
lock (_syncRoot)
{
if (_nativeTheme == null)
{
_nativeTheme = new NativeTheme();
}
}
}
return _nativeTheme;
}
}
/// <summary>
/// Setting this property to <see cref="ThemeSourceMode.System"/> will remove the override and everything will be reset to the OS default. By default 'ThemeSource' is <see cref="ThemeSourceMode.System"/>.
/// <para/>
/// Settings this property to <see cref="ThemeSourceMode.Dark"/> will have the following effects:
/// <list type="bullet">
/// <item>
/// <description><see cref="ShouldUseDarkColorsAsync"/> will be <see langword="true"/> when accessed</description>
/// </item>
/// <item>
/// <description>Any UI Electron renders on Linux and Windows including context menus, devtools, etc. will use the dark UI.</description>
/// </item>
/// <item>
/// <description>Any UI the OS renders on macOS including menus, window frames, etc. will use the dark UI.</description>
/// </item>
/// <item>
/// <description>The 'prefers-color-scheme' CSS query will match 'dark' mode.</description>
/// </item>
/// <item>
/// <description>The 'updated' event will be emitted</description>
/// </item>
/// </list>
/// <para/>
/// Settings this property to <see cref="ThemeSourceMode.Light"/> will have the following effects:
/// <list type="bullet">
/// <item>
/// <description><see cref="ShouldUseDarkColorsAsync"/> will be <see langword="false"/> when accessed</description>
/// </item>
/// <item>
/// <description>Any UI Electron renders on Linux and Windows including context menus, devtools, etc. will use the light UI.</description>
/// </item>
/// <item>
/// <description>Any UI the OS renders on macOS including menus, window frames, etc. will use the light UI.</description>
/// </item>
/// <item>
/// <description>The 'prefers-color-scheme' CSS query will match 'light' mode.</description>
/// </item>
/// <item>
/// <description>The 'updated' event will be emitted</description>
/// </item>
/// </list>
/// The usage of this property should align with a classic "dark mode" state machine in your application where the user has three options.
/// <para/>
/// <list type="bullet">
/// <item>
/// <description>Follow OS: SetThemeSource(ThemeSourceMode.System);</description>
/// </item>
/// <item>
/// <description>Dark Mode: SetThemeSource(ThemeSourceMode.Dark);</description>
/// </item>
/// <item>
/// <description>Light Mode: SetThemeSource(ThemeSourceMode.Light);</description>
/// </item>
/// </list>
/// Your application should then always use <see cref="ShouldUseDarkColorsAsync"/> to determine what CSS to apply.
/// </summary>
/// <param name="themeSourceMode">The new ThemeSource.</param>
public void SetThemeSource(ThemeSourceMode themeSourceMode)
{
var themeSource = themeSourceMode.GetDescription();
BridgeConnector.Socket.Emit("nativeTheme-themeSource", themeSource);
}
/// <summary>
/// A <see cref="ThemeSourceMode"/> property that can be <see cref="ThemeSourceMode.System"/>, <see cref="ThemeSourceMode.Light"/> or <see cref="ThemeSourceMode.Dark"/>. It is used to override (<seealso cref="SetThemeSource"/>) and
/// supercede the value that Chromium has chosen to use internally.
/// </summary>
public Task<ThemeSourceMode> GetThemeSourceAsync()
{
var taskCompletionSource = new TaskCompletionSource<ThemeSourceMode>();
BridgeConnector.Socket.On("nativeTheme-themeSource-getCompleted", (themeSource) =>
{
BridgeConnector.Socket.Off("nativeTheme-themeSource-getCompleted");
var themeSourceValue = (ThemeSourceMode)Enum.Parse(typeof(ThemeSourceMode), (string)themeSource, true);
taskCompletionSource.SetResult(themeSourceValue);
});
BridgeConnector.Socket.Emit("nativeTheme-themeSource-get");
return taskCompletionSource.Task;
}
/// <summary>
/// A <see cref="bool"/> for if the OS / Chromium currently has a dark mode enabled or is
/// being instructed to show a dark-style UI. If you want to modify this value you
/// should use <see cref="SetThemeSource"/>.
/// </summary>
public Task<bool> ShouldUseDarkColorsAsync()
{
var taskCompletionSource = new TaskCompletionSource<bool>();
BridgeConnector.Socket.On("nativeTheme-shouldUseDarkColors-completed", (shouldUseDarkColors) => {
BridgeConnector.Socket.Off("nativeTheme-shouldUseDarkColors-completed");
taskCompletionSource.SetResult((bool)shouldUseDarkColors);
});
BridgeConnector.Socket.Emit("nativeTheme-shouldUseDarkColors");
return taskCompletionSource.Task;
}
/// <summary>
/// A <see cref="bool"/> for if the OS / Chromium currently has high-contrast mode enabled or is
/// being instructed to show a high-contrast UI.
/// </summary>
public Task<bool> ShouldUseHighContrastColorsAsync()
{
var taskCompletionSource = new TaskCompletionSource<bool>();
BridgeConnector.Socket.On("nativeTheme-shouldUseHighContrastColors-completed", (shouldUseHighContrastColors) => {
BridgeConnector.Socket.Off("nativeTheme-shouldUseHighContrastColors-completed");
taskCompletionSource.SetResult((bool)shouldUseHighContrastColors);
});
BridgeConnector.Socket.Emit("nativeTheme-shouldUseHighContrastColors");
return taskCompletionSource.Task;
}
/// <summary>
/// A <see cref="bool"/> for if the OS / Chromium currently has an inverted color scheme or is
/// being instructed to use an inverted color scheme.
/// </summary>
public Task<bool> ShouldUseInvertedColorSchemeAsync()
{
var taskCompletionSource = new TaskCompletionSource<bool>();
BridgeConnector.Socket.On("nativeTheme-shouldUseInvertedColorScheme-completed", (shouldUseInvertedColorScheme) => {
BridgeConnector.Socket.Off("nativeTheme-shouldUseInvertedColorScheme-completed");
taskCompletionSource.SetResult((bool)shouldUseInvertedColorScheme);
});
BridgeConnector.Socket.Emit("nativeTheme-shouldUseInvertedColorScheme");
return taskCompletionSource.Task;
}
/// <summary>
/// Emitted when something in the underlying NativeTheme has changed. This normally means that either the value of <see cref="ShouldUseDarkColorsAsync"/>,
/// <see cref="ShouldUseHighContrastColorsAsync"/> or <see cref="ShouldUseInvertedColorSchemeAsync"/> has changed. You will have to check them to determine which one has changed.
/// </summary>
public event Action Updated
{
add
{
if (_updated == null)
{
BridgeConnector.Socket.On("nativeTheme-updated" + GetHashCode(), () =>
{
_updated();
});
BridgeConnector.Socket.Emit("register-nativeTheme-updated-event", GetHashCode());
}
_updated += value;
}
remove
{
_updated -= value;
if (_updated == null)
{
BridgeConnector.Socket.Off("nativeTheme-updated" + GetHashCode());
}
}
}
private event Action _updated;
}
}

View File

@@ -0,0 +1,242 @@
using System;
using System.Threading.Tasks;
namespace ElectronNET.API
{
/// <summary>
/// Monitor power state changes..
/// </summary>
public sealed class PowerMonitor
{
/// <summary>
/// Emitted when the system is about to lock the screen.
/// </summary>
public event Action OnLockScreen
{
add
{
if (_lockScreen == null)
{
BridgeConnector.Socket.On("pm-lock-screen" , () =>
{
_lockScreen();
});
BridgeConnector.Socket.Emit("register-pm-lock-screen");
}
_lockScreen += value;
}
remove
{
_lockScreen -= value;
if (_lockScreen == null)
BridgeConnector.Socket.Off("pm-lock-screen");
}
}
private event Action _lockScreen;
/// <summary>
/// Emitted when the system is about to unlock the screen.
/// </summary>
public event Action OnUnLockScreen
{
add
{
if (_unlockScreen == null)
{
BridgeConnector.Socket.On("pm-unlock-screen", () =>
{
_unlockScreen();
});
BridgeConnector.Socket.Emit("register-pm-unlock-screen");
}
_unlockScreen += value;
}
remove
{
_unlockScreen -= value;
if (_unlockScreen == null)
BridgeConnector.Socket.Off("pm-unlock-screen");
}
}
private event Action _unlockScreen;
/// <summary>
/// Emitted when the system is suspending.
/// </summary>
public event Action OnSuspend
{
add
{
if (_suspend == null)
{
BridgeConnector.Socket.On("pm-suspend", () =>
{
_suspend();
});
BridgeConnector.Socket.Emit("register-pm-suspend");
}
_suspend += value;
}
remove
{
_suspend -= value;
if (_suspend == null)
BridgeConnector.Socket.Off("pm-suspend");
}
}
private event Action _suspend;
/// <summary>
/// Emitted when system is resuming.
/// </summary>
public event Action OnResume
{
add
{
if (_resume == null)
{
BridgeConnector.Socket.On("pm-resume", () =>
{
_resume();
});
BridgeConnector.Socket.Emit("register-pm-resume");
}
_resume += value;
}
remove
{
_resume -= value;
if (_resume == null)
BridgeConnector.Socket.Off("pm-resume");
}
}
private event Action _resume;
/// <summary>
/// Emitted when the system changes to AC power.
/// </summary>
public event Action OnAC
{
add
{
if (_onAC == null)
{
BridgeConnector.Socket.On("pm-on-ac", () =>
{
_onAC();
});
BridgeConnector.Socket.Emit("register-pm-on-ac");
}
_onAC += value;
}
remove
{
_onAC -= value;
if (_onAC == null)
BridgeConnector.Socket.Off("pm-on-ac");
}
}
private event Action _onAC;
/// <summary>
/// Emitted when system changes to battery power.
/// </summary>
public event Action OnBattery
{
add
{
if (_onBattery == null)
{
BridgeConnector.Socket.On("pm-on-battery", () =>
{
_onBattery();
});
BridgeConnector.Socket.Emit("register-pm-on-battery");
}
_onBattery += value;
}
remove
{
_onBattery -= value;
if (_onBattery == null)
BridgeConnector.Socket.Off("pm-on-battery");
}
}
private event Action _onBattery;
/// <summary>
/// Emitted when the system is about to reboot or shut down. If the event handler
/// invokes `e.preventDefault()`, Electron will attempt to delay system shutdown in
/// order for the app to exit cleanly.If `e.preventDefault()` is called, the app
/// should exit as soon as possible by calling something like `app.quit()`.
/// </summary>
public event Action OnShutdown
{
add
{
if (_shutdown == null)
{
BridgeConnector.Socket.On("pm-shutdown", () =>
{
_shutdown();
});
BridgeConnector.Socket.Emit("register-pm-shutdown");
}
_shutdown += value;
}
remove
{
_shutdown -= value;
if (_shutdown == null)
BridgeConnector.Socket.Off("pm-on-shutdown");
}
}
private event Action _shutdown;
private static PowerMonitor _powerMonitor;
private static object _syncRoot = new object();
internal PowerMonitor() { }
internal static PowerMonitor Instance
{
get
{
if (_powerMonitor == null)
{
lock (_syncRoot)
{
if (_powerMonitor == null)
{
_powerMonitor = new PowerMonitor();
}
}
}
return _powerMonitor;
}
}
}
}

View File

@@ -1,7 +1,7 @@
namespace ElectronNET.API
{
/// <summary>
///
/// Event arguments for the <see cref="App.BeforeQuit"/> / <see cref="App.WillQuit"/> event.
/// </summary>
public sealed class QuitEventArgs
{
@@ -13,4 +13,4 @@
Electron.App.PreventQuit();
}
}
}
}

View File

@@ -20,9 +20,15 @@ namespace ElectronNET.API
/// </value>
public int Id { get; private set; }
/// <summary>
/// Query and modify a session's cookies.
/// </summary>
public Cookies Cookies { get; }
internal Session(int id)
{
Id = id;
Cookies = new Cookies(id);
}
/// <summary>

View File

@@ -2,9 +2,8 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using ElectronNET.API.Extensions;
namespace ElectronNET.API
{
@@ -40,17 +39,14 @@ namespace ElectronNET.API
/// <summary>
/// Show the given file in a file manager. If possible, select the file.
/// </summary>
/// <param name="fullPath"></param>
/// <returns>Whether the item was successfully shown.</returns>
public Task<bool> ShowItemInFolderAsync(string fullPath)
/// <param name="fullPath">The full path to the directory / file.</param>
public Task ShowItemInFolderAsync(string fullPath)
{
var taskCompletionSource = new TaskCompletionSource<bool>();
var taskCompletionSource = new TaskCompletionSource<object>();
BridgeConnector.Socket.On("shell-showItemInFolderCompleted", (success) =>
BridgeConnector.Socket.On("shell-showItemInFolderCompleted", () =>
{
BridgeConnector.Socket.Off("shell-showItemInFolderCompleted");
taskCompletionSource.SetResult((bool)success);
});
BridgeConnector.Socket.Emit("shell-showItemInFolder", fullPath);
@@ -59,22 +55,22 @@ namespace ElectronNET.API
}
/// <summary>
/// Open the given file in the desktops default manner.
/// Open the given file in the desktop's default manner.
/// </summary>
/// <param name="fullPath"></param>
/// <returns>Whether the item was successfully opened.</returns>
public Task<bool> OpenItemAsync(string fullPath)
/// <param name="path">The path to the directory / file.</param>
/// <returns>The error message corresponding to the failure if a failure occurred, otherwise <see cref="string.Empty"/>.</returns>
public Task<string> OpenPathAsync(string path)
{
var taskCompletionSource = new TaskCompletionSource<bool>();
var taskCompletionSource = new TaskCompletionSource<string>();
BridgeConnector.Socket.On("shell-openItemCompleted", (success) =>
BridgeConnector.Socket.On("shell-openPathCompleted", (errorMessage) =>
{
BridgeConnector.Socket.Off("shell-openItemCompleted");
BridgeConnector.Socket.Off("shell-openPathCompleted");
taskCompletionSource.SetResult((bool)success);
taskCompletionSource.SetResult((string) errorMessage);
});
BridgeConnector.Socket.Emit("shell-openItem", fullPath);
BridgeConnector.Socket.Emit("shell-openPath", path);
return taskCompletionSource.Task;
}
@@ -83,95 +79,50 @@ namespace ElectronNET.API
/// Open the given external protocol URL in the desktops default manner.
/// (For example, mailto: URLs in the users default mail agent).
/// </summary>
/// <param name="url"></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)
/// <param name="url">Max 2081 characters on windows.</param>
/// <returns>The error message corresponding to the failure if a failure occurred, otherwise <see cref="string.Empty"/>.</returns>
public Task<string> OpenExternalAsync(string url)
{
var taskCompletionSource = new TaskCompletionSource<bool>();
BridgeConnector.Socket.On("shell-openExternalCompleted", (success) =>
{
BridgeConnector.Socket.Off("shell-openExternalCompleted");
taskCompletionSource.SetResult((bool)success);
});
BridgeConnector.Socket.Emit("shell-openExternal", url);
return taskCompletionSource.Task;
return OpenExternalAsync(url, null);
}
/// <summary>
/// Open the given external protocol URL in the desktops default manner.
/// (For example, mailto: URLs in the users default mail agent).
/// </summary>
/// <param name="url"></param>
/// <param name="options">macOS only</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)
/// <param name="url">Max 2081 characters on windows.</param>
/// <param name="options">Controls the behavior of OpenExternal.</param>
/// <returns>The error message corresponding to the failure if a failure occurred, otherwise <see cref="string.Empty"/>.</returns>
public Task<string> OpenExternalAsync(string url, OpenExternalOptions options)
{
var taskCompletionSource = new TaskCompletionSource<bool>();
var taskCompletionSource = new TaskCompletionSource<string>();
BridgeConnector.Socket.On("shell-openExternalCompleted", (success) =>
BridgeConnector.Socket.On("shell-openExternalCompleted", (error) =>
{
BridgeConnector.Socket.Off("shell-openExternalCompleted");
taskCompletionSource.SetResult((bool)success);
taskCompletionSource.SetResult((string) error);
});
BridgeConnector.Socket.Emit("shell-openExternal", url, JObject.FromObject(options, _jsonSerializer));
if (options == null)
{
BridgeConnector.Socket.Emit("shell-openExternal", url);
}
else
{
BridgeConnector.Socket.Emit("shell-openExternal", url, JObject.FromObject(options, _jsonSerializer));
}
return taskCompletionSource.Task;
}
/// <summary>
/// Open the given external protocol URL in the desktops default manner.
/// (For example, mailto: URLs in the users default mail agent).
/// Move the given file to trash and returns a <see cref="bool"/> status for the operation.
/// </summary>
/// <param name="url"></param>
/// <param name="options">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> errorAction)
{
var taskCompletionSource = new TaskCompletionSource<bool>();
BridgeConnector.Socket.On("shell-openExternalCompleted", (success) =>
{
BridgeConnector.Socket.Off("shell-openExternalCompleted");
taskCompletionSource.SetResult((bool)success);
});
BridgeConnector.Socket.Off("shell-openExternalCallback");
BridgeConnector.Socket.On("shell-openExternalCallback", (args) => {
var urlKey = ((JArray)args).First.ToString();
var error = ((JArray)args).Last.ToObject<Error>();
if(_openExternalCallbacks.ContainsKey(urlKey))
{
_openExternalCallbacks[urlKey](error);
}
});
_openExternalCallbacks.Add(url, errorAction);
BridgeConnector.Socket.Emit("shell-openExternal", url, JObject.FromObject(options, _jsonSerializer), true);
return taskCompletionSource.Task;
}
private Dictionary<string, Action<Error>> _openExternalCallbacks = new Dictionary<string, Action<Error>>();
/// <summary>
/// Move the given file to trash and returns a boolean status for the operation.
/// </summary>
/// <param name="fullPath"></param>
/// <param name="fullPath">The full path to the directory / file.</param>
/// <param name="deleteOnFail">Whether or not to unilaterally remove the item if the Trash is disabled or unsupported on the volume.</param>
/// <returns> Whether the item was successfully moved to the trash.</returns>
public Task<bool> MoveItemToTrashAsync(string fullPath)
public Task<bool> MoveItemToTrashAsync(string fullPath, bool deleteOnFail)
{
var taskCompletionSource = new TaskCompletionSource<bool>();
@@ -179,10 +130,10 @@ namespace ElectronNET.API
{
BridgeConnector.Socket.Off("shell-moveItemToTrashCompleted");
taskCompletionSource.SetResult((bool)success);
taskCompletionSource.SetResult((bool) success);
});
BridgeConnector.Socket.Emit("shell-moveItemToTrash", fullPath);
BridgeConnector.Socket.Emit("shell-moveItemToTrash", fullPath, deleteOnFail);
return taskCompletionSource.Task;
}
@@ -198,9 +149,9 @@ namespace ElectronNET.API
/// <summary>
/// Creates or updates a shortcut link at shortcutPath.
/// </summary>
/// <param name="shortcutPath"></param>
/// <param name="operation"></param>
/// <param name="options"></param>
/// <param name="shortcutPath">The path to the shortcut.</param>
/// <param name="operation">Default is <see cref="ShortcutLinkOperation.Create"/></param>
/// <param name="options">Structure of a shortcut.</param>
/// <returns>Whether the shortcut was created successfully.</returns>
public Task<bool> WriteShortcutLinkAsync(string shortcutPath, ShortcutLinkOperation operation, ShortcutDetails options)
{
@@ -210,21 +161,20 @@ namespace ElectronNET.API
{
BridgeConnector.Socket.Off("shell-writeShortcutLinkCompleted");
taskCompletionSource.SetResult((bool)success);
taskCompletionSource.SetResult((bool) success);
});
BridgeConnector.Socket.Emit("shell-writeShortcutLink", shortcutPath, operation.ToString(), JObject.FromObject(options, _jsonSerializer));
BridgeConnector.Socket.Emit("shell-writeShortcutLink", shortcutPath, operation.GetDescription(), JObject.FromObject(options, _jsonSerializer));
return taskCompletionSource.Task;
}
/// <summary>
/// Resolves the shortcut link at shortcutPath.
///
/// An exception will be thrown when any error happens.
/// </summary>
/// <param name="shortcutPath"></param>
/// <returns></returns>
/// <param name="shortcutPath">The path tot the shortcut.</param>
/// <returns><see cref="ShortcutDetails"/> of the shortcut.</returns>
public Task<ShortcutDetails> ReadShortcutLinkAsync(string shortcutPath)
{
var taskCompletionSource = new TaskCompletionSource<ShortcutDetails>();
@@ -233,7 +183,10 @@ namespace ElectronNET.API
{
BridgeConnector.Socket.Off("shell-readShortcutLinkCompleted");
taskCompletionSource.SetResult((ShortcutDetails)shortcutDetails);
var shortcutObject = shortcutDetails as JObject;
var details = shortcutObject?.ToObject<ShortcutDetails>();
taskCompletionSource.SetResult(details);
});
BridgeConnector.Socket.Emit("shell-readShortcutLink", shortcutPath);
@@ -241,11 +194,11 @@ namespace ElectronNET.API
return taskCompletionSource.Task;
}
private JsonSerializer _jsonSerializer = new JsonSerializer()
private readonly JsonSerializer _jsonSerializer = new JsonSerializer()
{
ContractResolver = new CamelCasePropertyNamesContractResolver(),
NullValueHandling = NullValueHandling.Ignore,
DefaultValueHandling = DefaultValueHandling.Ignore
};
}
}
}

View File

@@ -263,6 +263,15 @@ namespace ElectronNET.API
});
}
/// <summary>
/// Shows the Traybar (empty).
/// </summary>
/// <param name="image">The image.</param>
public void Show(string image)
{
BridgeConnector.Socket.Emit("create-tray", image);
}
/// <summary>
/// Destroys the tray icon immediately.
/// </summary>

View File

@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Hosting;
using System;
using System.IO;
using Microsoft.Extensions.DependencyInjection;
namespace ElectronNET.API
{
@@ -32,6 +33,11 @@ namespace ElectronNET.API
if (HybridSupport.IsElectronActive)
{
builder.ConfigureServices(services =>
{
services.AddHostedService<LifetimeServiceHost>();
});
// check for the content folder if its exists in base director otherwise no need to include
// It was used before because we are publishing the project which copies everything to bin folder and contentroot wwwroot was folder there.
// now we have implemented the live reload if app is run using /watch then we need to use the default project path.
@@ -49,4 +55,4 @@ namespace ElectronNET.API
return builder;
}
}
}
}

View File

@@ -20,6 +20,7 @@ namespace ElectronNET.CLI.Commands.Actions
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "browserWindows.js", "api.");
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "commandLine.js", "api.");
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "dialog.js", "api.");
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "dock.js", "api.");
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "menu.js", "api.");
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "notification.js", "api.");
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "tray.js", "api.");
@@ -30,6 +31,8 @@ namespace ElectronNET.CLI.Commands.Actions
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "clipboard.js", "api.");
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "autoUpdater.js", "api.");
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "browserView.js", "api.");
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "powerMonitor.js", "api.");
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "nativeTheme.js", "api.");
string splashscreenFolder = Path.Combine(tempPath, "splashscreen");
if (Directory.Exists(splashscreenFolder) == false)

View File

@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using ElectronNET.CLI.Commands.Actions;
@@ -106,7 +105,7 @@ namespace ElectronNET.CLI.Commands
publishReadyToRun += "true";
}
var resultCode = ProcessHelper.CmdExecute($"dotnet publish -r {platformInfo.NetCorePublishRid} -c {configuration} --output \"{tempBinPath}\" {publishReadyToRun} --self-contained", Directory.GetCurrentDirectory());
var resultCode = ProcessHelper.CmdExecute($"dotnet publish -r {platformInfo.NetCorePublishRid} -c \"{configuration}\" --output \"{tempBinPath}\" {publishReadyToRun} --self-contained", Directory.GetCurrentDirectory());
if (resultCode != 0)
{
@@ -187,7 +186,7 @@ namespace ElectronNET.CLI.Commands
ProcessHelper.CmdExecute($"node build-helper.js " + manifestFileName, tempPath);
Console.WriteLine($"Package Electron App for Platform {platformInfo.ElectronPackerPlatform}...");
ProcessHelper.CmdExecute($"npx electron-builder . --config=./bin/electron-builder.json --{platformInfo.ElectronPackerPlatform} --{electronArch} -c.electronVersion=8.2.3 {electronParams}", tempPath);
ProcessHelper.CmdExecute($"npx electron-builder --config=./bin/electron-builder.json --{platformInfo.ElectronPackerPlatform} --{electronArch} -c.electronVersion=9.0.5 {electronParams}", tempPath);
Console.WriteLine("... done");

View File

@@ -27,6 +27,7 @@ namespace ElectronNET.CLI.Commands
private string _manifest = "manifest";
private string _clearCache = "clear-cache";
private string _paramPublishReadyToRun = "PublishReadyToRun";
private string _paramDotNetConfig = "dotnet-configuration";
public Task<bool> ExecuteAsync()
{
@@ -73,9 +74,15 @@ namespace ElectronNET.CLI.Commands
publishReadyToRun += "true";
}
string configuration = "Debug";
if (parser.Arguments.ContainsKey(_paramDotNetConfig))
{
configuration = parser.Arguments[_paramDotNetConfig][0];
}
if (parser != null && !parser.Arguments.ContainsKey("watch"))
{
resultCode = ProcessHelper.CmdExecute($"dotnet publish -r {platformInfo.NetCorePublishRid} --output \"{tempBinPath}\" {publishReadyToRun} --no-self-contained", aspCoreProjectPath);
resultCode = ProcessHelper.CmdExecute($"dotnet publish -r {platformInfo.NetCorePublishRid} -c \"{configuration}\" --output \"{tempBinPath}\" {publishReadyToRun} --no-self-contained", aspCoreProjectPath);
}
if (resultCode != 0)
@@ -149,7 +156,5 @@ namespace ElectronNET.CLI.Commands
return true;
});
}
}
}

View File

@@ -61,6 +61,7 @@
<EmbeddedResource Include="..\ElectronNET.Host\api\browserWindows.js" Link="ElectronHost\api\browserWindows.js" />
<EmbeddedResource Include="..\ElectronNET.Host\api\commandLine.js" Link="ElectronHost\api\commandLine.js" />
<EmbeddedResource Include="..\ElectronNET.Host\api\dialog.js" Link="ElectronHost\api\dialog.js" />
<EmbeddedResource Include="..\ElectronNET.Host\api\dock.js" Link="ElectronHost\api\dock.js" />
<EmbeddedResource Include="..\ElectronNET.Host\api\menu.js" Link="ElectronHost\api\menu.js" />
<EmbeddedResource Include="..\ElectronNET.Host\api\notification.js" Link="ElectronHost\api\notification.js" />
<EmbeddedResource Include="..\ElectronNET.Host\api\tray.js" Link="ElectronHost\api\tray.js" />
@@ -71,6 +72,8 @@
<EmbeddedResource Include="..\ElectronNET.Host\api\clipboard.js" Link="ElectronHost\api\clipboard.js" />
<EmbeddedResource Include="..\ElectronNET.Host\api\autoUpdater.js" Link="ElectronHost\api\autoUpdater.js" />
<EmbeddedResource Include="..\ElectronNET.Host\api\browserView.js" Link="ElectronHost\api\browserView.js" />
<EmbeddedResource Include="..\ElectronNET.Host\api\powerMonitor.js" Link="ElectronHost\api\powerMonitor.js" />
<EmbeddedResource Include="..\ElectronNET.Host\api\nativeTheme.js" Link="ElectronHost\api\nativeTheme.js" />
</ItemGroup>
<ItemGroup>

View File

@@ -2,7 +2,7 @@
"profiles": {
"ElectronNET.CLI": {
"commandName": "Project",
"commandLineArgs": "start /project-path \"C:\\Users\\Rizvi\\source\\repos\\Electron.NET\\ElectronNET.WebApp\" /watch"
"commandLineArgs": "start /project-path \"$(SolutionDir)ElectronNET.WebApp\" /watch"
}
}
}

View File

@@ -1,5 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Connector = void 0;
class Connector {
constructor(socket,
// @ts-ignore

View File

@@ -1 +1 @@
{"version":3,"file":"connector.js","sourceRoot":"","sources":["connector.ts"],"names":[],"mappings":";;AAAA,MAAa,SAAS;IAClB,YAAoB,MAAuB;IACvC,aAAa;IACN,GAAiB;QAFR,WAAM,GAAN,MAAM,CAAiB;QAEhC,QAAG,GAAH,GAAG,CAAc;IAAI,CAAC;IAEjC,EAAE,CAAC,GAAW,EAAE,cAAwB;QACpC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE;YACnC,MAAM,EAAE,GAAW,IAAI,CAAC,GAAG,EAAE,CAAC;YAE9B,IAAI;gBACA,cAAc,CAAC,GAAG,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE;oBAC7B,IAAI,IAAI,EAAE;wBACN,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,WAAW,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;qBACjD;gBACL,CAAC,CAAC,CAAC;aACN;YAAC,OAAO,KAAK,EAAE;gBACZ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,QAAQ,EAAE,EAAE,EAAE,qBAAqB,EAAE,KAAK,CAAC,CAAC;aACtE;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AApBD,8BAoBC"}
{"version":3,"file":"connector.js","sourceRoot":"","sources":["connector.ts"],"names":[],"mappings":";;;AAAA,MAAa,SAAS;IAClB,YAAoB,MAAuB;IACvC,aAAa;IACN,GAAiB;QAFR,WAAM,GAAN,MAAM,CAAiB;QAEhC,QAAG,GAAH,GAAG,CAAc;IAAI,CAAC;IAEjC,EAAE,CAAC,GAAW,EAAE,cAAwB;QACpC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE;YACnC,MAAM,EAAE,GAAW,IAAI,CAAC,GAAG,EAAE,CAAC;YAE9B,IAAI;gBACA,cAAc,CAAC,GAAG,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE;oBAC7B,IAAI,IAAI,EAAE;wBACN,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,WAAW,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;qBACjD;gBACL,CAAC,CAAC,CAAC;aACN;YAAC,OAAO,KAAK,EAAE;gBACZ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,QAAQ,EAAE,EAAE,EAAE,qBAAqB,EAAE,KAAK,CAAC,CAAC;aACtE;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AApBD,8BAoBC"}

View File

@@ -1,5 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HookService = void 0;
const connector_1 = require("./connector");
class HookService extends connector_1.Connector {
constructor(socket, app) {

View File

@@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAEA,2CAAwC;AAExC,MAAa,WAAY,SAAQ,qBAAS;IACtC,YAAY,MAAuB,EAAS,GAAiB;QACzD,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QADqB,QAAG,GAAH,GAAG,CAAc;IAE7D,CAAC;IAED,WAAW;QACP,8CAA8C;IAClD,CAAC;CACJ;AARD,kCAQC"}
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AAExC,MAAa,WAAY,SAAQ,qBAAS;IACtC,YAAY,MAAuB,EAAS,GAAiB;QACzD,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QADqB,QAAG,GAAH,GAAG,CAAc;IAE7D,CAAC;IAED,WAAW;QACP,8CAA8C;IAClD,CAAC;CACJ;AARD,kCAQC"}

View File

@@ -1,23 +1,28 @@
"use strict";
let isQuitWindowAllClosed = true, electronSocket;
let appWindowAllClosedEventId;
module.exports = (socket, app) => {
electronSocket = socket;
// Quit when all windows are closed.
// By default, quit when all windows are closed
app.on('window-all-closed', () => {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin' &&
isQuitWindowAllClosed) {
if (process.platform !== 'darwin' && isQuitWindowAllClosed) {
app.quit();
}
else if (appWindowAllClosedEventId) {
// If the user is on macOS
// - OR -
// If the user has indicated NOT to quit when all windows are closed,
// emit the event.
electronSocket.emit('app-window-all-closed' + appWindowAllClosedEventId);
}
});
socket.on('quit-app-window-all-closed-event', (quit) => {
isQuitWindowAllClosed = quit;
});
socket.on('register-app-window-all-closed-event', (id) => {
app.on('window-all-closed', () => {
electronSocket.emit('app-window-all-closed' + id);
});
appWindowAllClosedEventId = id;
});
socket.on('register-app-before-quit-event', (id) => {
app.on('before-quit', (event) => {
@@ -65,8 +70,8 @@ module.exports = (socket, app) => {
socket.on('appRelaunch', (options) => {
app.relaunch(options);
});
socket.on('appFocus', () => {
app.focus();
socket.on('appFocus', (options) => {
app.focus(options);
});
socket.on('appHide', () => {
app.hide();
@@ -78,6 +83,9 @@ module.exports = (socket, app) => {
const path = app.getAppPath();
electronSocket.emit('appGetAppPathCompleted', path);
});
socket.on('appSetAppLogsPath', (path) => {
app.setAppLogsPath(path);
});
socket.on('appGetPath', (name) => {
const path = app.getPath(name);
electronSocket.emit('appGetPathCompleted', path);
@@ -155,16 +163,26 @@ module.exports = (socket, app) => {
const success = app.requestSingleInstanceLock();
electronSocket.emit('appRequestSingleInstanceLockCompleted', success);
});
socket.on('appHasSingleInstanceLock', () => {
const hasLock = app.hasSingleInstanceLock();
electronSocket.emit('appHasSingleInstanceLockCompleted', hasLock);
});
socket.on('appReleaseSingleInstanceLock', () => {
app.releaseSingleInstanceLock();
});
socket.on('appSetUserActivity', (type, userInfo, webpageURL) => {
app.setUserActivity(type, userInfo, webpageURL);
socket.on('appSetUserActivity', (type, userInfo, webpageUrl) => {
app.setUserActivity(type, userInfo, webpageUrl);
});
socket.on('appGetCurrentActivityType', () => {
const activityType = app.getCurrentActivityType();
electronSocket.emit('appGetCurrentActivityTypeCompleted', activityType);
});
socket.on('appInvalidateCurrentActivity', () => {
app.invalidateCurrentActivity();
});
socket.on('appResignCurrentActivity', () => {
app.resignCurrentActivity();
});
socket.on('appSetAppUserModelId', (id) => {
app.setAppUserModelId(id);
});
@@ -204,42 +222,20 @@ module.exports = (socket, app) => {
const isAccessibilitySupportEnabled = app.isAccessibilitySupportEnabled();
electronSocket.emit('appIsAccessibilitySupportEnabledCompleted', isAccessibilitySupportEnabled);
});
socket.on('appSetAccessibilitySupportEnabled', (enabled) => {
app.setAccessibilitySupportEnabled(enabled);
});
socket.on('appShowAboutPanel', () => {
app.showAboutPanel();
});
socket.on('appSetAboutPanelOptions', (options) => {
app.setAboutPanelOptions(options);
});
socket.on('appDockBounce', (type) => {
const id = app.dock.bounce(type);
electronSocket.emit('appDockBounceCompleted', id);
socket.on('appGetUserAgentFallback', () => {
electronSocket.emit('appGetUserAgentFallbackCompleted', app.userAgentFallback);
});
socket.on('appDockCancelBounce', (id) => {
app.dock.cancelBounce(id);
});
socket.on('appDockDownloadFinished', (filePath) => {
app.dock.downloadFinished(filePath);
});
socket.on('appDockSetBadge', (text) => {
app.dock.setBadge(text);
});
socket.on('appDockGetBadge', () => {
const text = app.dock.getBadge();
electronSocket.emit('appDockGetBadgeCompleted', text);
});
socket.on('appDockHide', () => {
app.dock.hide();
});
socket.on('appDockShow', () => {
app.dock.show();
});
socket.on('appDockIsVisible', () => {
const isVisible = app.dock.isVisible();
electronSocket.emit('appDockIsVisibleCompleted', isVisible);
});
// TODO: Menü Lösung muss noch implementiert werden
socket.on('appDockSetMenu', (menu) => {
app.dock.setMenu(menu);
});
socket.on('appDockSetIcon', (image) => {
app.dock.setIcon(image);
socket.on('appSetUserAgentFallback', (userAgent) => {
app.userAgentFallback = userAgent;
});
};
//# sourceMappingURL=app.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,13 +1,20 @@
let isQuitWindowAllClosed = true, electronSocket;
let appWindowAllClosedEventId;
export = (socket: SocketIO.Socket, app: Electron.App) => {
electronSocket = socket;
// Quit when all windows are closed.
// By default, quit when all windows are closed
app.on('window-all-closed', () => {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin' &&
isQuitWindowAllClosed) {
if (process.platform !== 'darwin' && isQuitWindowAllClosed) {
app.quit();
} else if (appWindowAllClosedEventId) {
// If the user is on macOS
// - OR -
// If the user has indicated NOT to quit when all windows are closed,
// emit the event.
electronSocket.emit('app-window-all-closed' + appWindowAllClosedEventId);
}
});
@@ -16,9 +23,7 @@ export = (socket: SocketIO.Socket, app: Electron.App) => {
});
socket.on('register-app-window-all-closed-event', (id) => {
app.on('window-all-closed', () => {
electronSocket.emit('app-window-all-closed' + id);
});
appWindowAllClosedEventId = id;
});
socket.on('register-app-before-quit-event', (id) => {
@@ -79,8 +84,8 @@ export = (socket: SocketIO.Socket, app: Electron.App) => {
app.relaunch(options);
});
socket.on('appFocus', () => {
app.focus();
socket.on('appFocus', (options) => {
app.focus(options);
});
socket.on('appHide', () => {
@@ -96,6 +101,10 @@ export = (socket: SocketIO.Socket, app: Electron.App) => {
electronSocket.emit('appGetAppPathCompleted', path);
});
socket.on('appSetAppLogsPath', (path) => {
app.setAppLogsPath(path);
});
socket.on('appGetPath', (name) => {
const path = app.getPath(name);
electronSocket.emit('appGetPathCompleted', path);
@@ -195,18 +204,32 @@ export = (socket: SocketIO.Socket, app: Electron.App) => {
electronSocket.emit('appRequestSingleInstanceLockCompleted', success);
});
socket.on('appHasSingleInstanceLock', () => {
const hasLock = app.hasSingleInstanceLock();
electronSocket.emit('appHasSingleInstanceLockCompleted', hasLock);
});
socket.on('appReleaseSingleInstanceLock', () => {
app.releaseSingleInstanceLock();
});
socket.on('appSetUserActivity', (type, userInfo, webpageURL) => {
app.setUserActivity(type, userInfo, webpageURL);
socket.on('appSetUserActivity', (type, userInfo, webpageUrl) => {
app.setUserActivity(type, userInfo, webpageUrl);
});
socket.on('appGetCurrentActivityType', () => {
const activityType = app.getCurrentActivityType();
electronSocket.emit('appGetCurrentActivityTypeCompleted', activityType);
});
socket.on('appInvalidateCurrentActivity', () => {
app.invalidateCurrentActivity();
});
socket.on('appResignCurrentActivity', () => {
app.resignCurrentActivity();
});
socket.on('appSetAppUserModelId', (id) => {
app.setAppUserModelId(id);
@@ -257,51 +280,23 @@ export = (socket: SocketIO.Socket, app: Electron.App) => {
electronSocket.emit('appIsAccessibilitySupportEnabledCompleted', isAccessibilitySupportEnabled);
});
socket.on('appSetAccessibilitySupportEnabled', (enabled) => {
app.setAccessibilitySupportEnabled(enabled);
});
socket.on('appShowAboutPanel', () => {
app.showAboutPanel();
});
socket.on('appSetAboutPanelOptions', (options) => {
app.setAboutPanelOptions(options);
});
socket.on('appGetUserAgentFallback', () => {
electronSocket.emit('appGetUserAgentFallbackCompleted', app.userAgentFallback);
});
socket.on('appDockBounce', (type) => {
const id = app.dock.bounce(type);
electronSocket.emit('appDockBounceCompleted', id);
});
socket.on('appDockCancelBounce', (id) => {
app.dock.cancelBounce(id);
});
socket.on('appDockDownloadFinished', (filePath) => {
app.dock.downloadFinished(filePath);
});
socket.on('appDockSetBadge', (text) => {
app.dock.setBadge(text);
});
socket.on('appDockGetBadge', () => {
const text = app.dock.getBadge();
electronSocket.emit('appDockGetBadgeCompleted', text);
});
socket.on('appDockHide', () => {
app.dock.hide();
});
socket.on('appDockShow', () => {
app.dock.show();
});
socket.on('appDockIsVisible', () => {
const isVisible = app.dock.isVisible();
electronSocket.emit('appDockIsVisibleCompleted', isVisible);
});
// TODO: Menü Lösung muss noch implementiert werden
socket.on('appDockSetMenu', (menu) => {
app.dock.setMenu(menu);
});
socket.on('appDockSetIcon', (image) => {
app.dock.setIcon(image);
socket.on('appSetUserAgentFallback', (userAgent) => {
app.userAgentFallback = userAgent;
});
};

View File

@@ -435,6 +435,10 @@ module.exports = (socket, app) => {
const isKiosk = getWindowById(id).isKiosk();
electronSocket.emit('browserWindow-isKiosk-completed', isKiosk);
});
socket.on('browserWindowGetNativeWindowHandle', (id) => {
const nativeWindowHandle = getWindowById(id).getNativeWindowHandle().readInt32LE(0).toString(16);
electronSocket.emit('browserWindow-getNativeWindowHandle-completed', nativeWindowHandle);
});
socket.on('browserWindowSetRepresentedFilename', (id, filename) => {
getWindowById(id).setRepresentedFilename(filename);
});
@@ -487,6 +491,9 @@ module.exports = (socket, app) => {
socket.on('browserWindowSetProgressBar', (id, progress) => {
getWindowById(id).setProgressBar(progress);
});
socket.on('browserWindowSetProgressBar', (id, progress, options) => {
getWindowById(id).setProgressBar(progress, options);
});
socket.on('browserWindowSetHasShadow', (id, hasShadow) => {
getWindowById(id).setHasShadow(hasShadow);
});

File diff suppressed because one or more lines are too long

View File

@@ -553,6 +553,11 @@ export = (socket: SocketIO.Socket, app: Electron.App) => {
electronSocket.emit('browserWindow-isKiosk-completed', isKiosk);
});
socket.on('browserWindowGetNativeWindowHandle', (id) => {
const nativeWindowHandle = getWindowById(id).getNativeWindowHandle().readInt32LE(0).toString(16);
electronSocket.emit('browserWindow-getNativeWindowHandle-completed', nativeWindowHandle);
});
socket.on('browserWindowSetRepresentedFilename', (id, filename) => {
getWindowById(id).setRepresentedFilename(filename);
});
@@ -623,6 +628,10 @@ export = (socket: SocketIO.Socket, app: Electron.App) => {
getWindowById(id).setProgressBar(progress);
});
socket.on('browserWindowSetProgressBar', (id, progress, options) => {
getWindowById(id).setProgressBar(progress, options);
});
socket.on('browserWindowSetHasShadow', (id, hasShadow) => {
getWindowById(id).setHasShadow(hasShadow);
});

View File

@@ -49,19 +49,20 @@ module.exports = (socket) => {
electron_1.clipboard.write(data, type);
});
socket.on('clipboard-readImage', (type) => {
var image = electron_1.clipboard.readImage(type);
const image = electron_1.clipboard.readImage(type);
electronSocket.emit('clipboard-readImage-Completed', { 1: image.toPNG().toString('base64') });
});
socket.on('clipboard-writeImage', (data, type) => {
var data = JSON.parse(data);
const ni = electron_1.nativeImage.createEmpty();
for (var i in data) {
var scaleFactor = i;
var bytes = data[i];
var buff = Buffer.from(bytes, 'base64');
ni.addRepresentation({ scaleFactor: +scaleFactor, buffer: buff });
const dataContent = JSON.parse(data);
const image = electron_1.nativeImage.createEmpty();
// tslint:disable-next-line: forin
for (const key in dataContent) {
const scaleFactor = key;
const bytes = data[key];
const buffer = Buffer.from(bytes, 'base64');
image.addRepresentation({ scaleFactor: +scaleFactor, buffer: buffer });
}
electron_1.clipboard.writeImage(ni, type);
electron_1.clipboard.writeImage(image, type);
});
};
//# sourceMappingURL=clipboard.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"clipboard.js","sourceRoot":"","sources":["clipboard.ts"],"names":[],"mappings":";AAAA,uCAAkD;AAClD,IAAI,cAAc,CAAC;AAEnB,iBAAS,CAAC,MAAuB,EAAE,EAAE;IACjC,cAAc,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,IAAI,EAAE,EAAE;QACrC,MAAM,IAAI,GAAG,oBAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACtC,cAAc,CAAC,IAAI,CAAC,8BAA8B,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,qBAAqB,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;QAC5C,oBAAS,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,IAAI,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,oBAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzC,cAAc,CAAC,IAAI,CAAC,8BAA8B,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,qBAAqB,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;QAC9C,oBAAS,CAAC,SAAS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C;IACtC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}

View File

@@ -62,20 +62,22 @@ export = (socket: SocketIO.Socket) => {
});
socket.on('clipboard-readImage', (type) => {
var image = clipboard.readImage(type);
const image = clipboard.readImage(type);
electronSocket.emit('clipboard-readImage-Completed', { 1: image.toPNG().toString('base64') });
});
socket.on('clipboard-writeImage', (data, type) => {
var data = JSON.parse(data);
const ni = nativeImage.createEmpty();
for (var i in data) {
var scaleFactor = i;
var bytes = data[i];
var buff = Buffer.from(bytes, 'base64');
ni.addRepresentation({ scaleFactor: +scaleFactor, buffer: buff });
const dataContent = JSON.parse(data);
const image = nativeImage.createEmpty();
// tslint:disable-next-line: forin
for (const key in dataContent) {
const scaleFactor = key;
const bytes = data[key];
const buffer = Buffer.from(bytes, 'base64');
image.addRepresentation({ scaleFactor: +scaleFactor, buffer: buffer });
}
clipboard.writeImage(ni, type);
clipboard.writeImage(image, type);
});
};

View File

@@ -0,0 +1,46 @@
"use strict";
const electron_1 = require("electron");
let electronSocket;
module.exports = (socket) => {
electronSocket = socket;
socket.on('dock-bounce', (type) => {
const id = electron_1.app.dock.bounce(type);
electronSocket.emit('dock-bounce-completed', id);
});
socket.on('dock-cancelBounce', (id) => {
electron_1.app.dock.cancelBounce(id);
});
socket.on('dock-downloadFinished', (filePath) => {
electron_1.app.dock.downloadFinished(filePath);
});
socket.on('dock-setBadge', (text) => {
electron_1.app.dock.setBadge(text);
});
socket.on('dock-getBadge', () => {
const text = electron_1.app.dock.getBadge();
electronSocket.emit('dock-getBadge-completed', text);
});
socket.on('dock-hide', () => {
electron_1.app.dock.hide();
});
socket.on('dock-show', () => {
electron_1.app.dock.show();
});
socket.on('dock-isVisible', () => {
const isVisible = electron_1.app.dock.isVisible();
electronSocket.emit('dock-isVisible-completed', isVisible);
});
// TODO: Menu (macOS) still to be implemented
socket.on('dock-setMenu', (menu) => {
electron_1.app.dock.setMenu(menu);
});
// TODO: Menu (macOS) still to be implemented
socket.on('dock-getMenu', () => {
const menu = electron_1.app.dock.getMenu();
electronSocket.emit('dock-getMenu-completed', menu);
});
socket.on('dock-setIcon', (image) => {
electron_1.app.dock.setIcon(image);
});
};
//# sourceMappingURL=dock.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"dock.js","sourceRoot":"","sources":["dock.ts"],"names":[],"mappings":";AAAA,uCAA+B;AAC/B,IAAI,cAAc,CAAC;AAEnB,iBAAS,CAAC,MAAuB,EAAE,EAAE;IACjC,cAAc,GAAG,MAAM,CAAC;IAExB,MAAM,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE;QAC9B,MAAM,EAAE,GAAG,cAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACjC,cAAc,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,EAAE,EAAE,EAAE;QAClC,cAAG,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,EAAE;QAC5C,cAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,eAAe,EAAE,CAAC,IAAI,EAAE,EAAE;QAChC,cAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,eAAe,EAAE,GAAG,EAAE;QAC5B,MAAM,IAAI,GAAG,cAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACjC,cAAc,CAAC,IAAI,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;QACxB,cAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;QACxB,cAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,gBAAgB,EAAE,GAAG,EAAE;QAC7B,MAAM,SAAS,GAAG,cAAG,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;QACvC,cAAc,CAAC,IAAI,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,6CAA6C;IAC7C,MAAM,CAAC,EAAE,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE;QAC/B,cAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,6CAA6C;IAC7C,MAAM,CAAC,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;QAC3B,MAAM,IAAI,GAAG,cAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QAChC,cAAc,CAAC,IAAI,CAAC,wBAAwB,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE;QAChC,cAAG,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}

View File

@@ -0,0 +1,56 @@
import { app } from 'electron';
let electronSocket;
export = (socket: SocketIO.Socket) => {
electronSocket = socket;
socket.on('dock-bounce', (type) => {
const id = app.dock.bounce(type);
electronSocket.emit('dock-bounce-completed', id);
});
socket.on('dock-cancelBounce', (id) => {
app.dock.cancelBounce(id);
});
socket.on('dock-downloadFinished', (filePath) => {
app.dock.downloadFinished(filePath);
});
socket.on('dock-setBadge', (text) => {
app.dock.setBadge(text);
});
socket.on('dock-getBadge', () => {
const text = app.dock.getBadge();
electronSocket.emit('dock-getBadge-completed', text);
});
socket.on('dock-hide', () => {
app.dock.hide();
});
socket.on('dock-show', () => {
app.dock.show();
});
socket.on('dock-isVisible', () => {
const isVisible = app.dock.isVisible();
electronSocket.emit('dock-isVisible-completed', isVisible);
});
// TODO: Menu (macOS) still to be implemented
socket.on('dock-setMenu', (menu) => {
app.dock.setMenu(menu);
});
// TODO: Menu (macOS) still to be implemented
socket.on('dock-getMenu', () => {
const menu = app.dock.getMenu();
electronSocket.emit('dock-getMenu-completed', menu);
});
socket.on('dock-setIcon', (image) => {
app.dock.setIcon(image);
});
};

View File

@@ -0,0 +1,31 @@
"use strict";
const electron_1 = require("electron");
let electronSocket;
module.exports = (socket) => {
electronSocket = socket;
socket.on('nativeTheme-shouldUseDarkColors', () => {
const shouldUseDarkColors = electron_1.nativeTheme.shouldUseDarkColors;
electronSocket.emit('nativeTheme-shouldUseDarkColors-completed', shouldUseDarkColors);
});
socket.on('nativeTheme-shouldUseHighContrastColors', () => {
const shouldUseHighContrastColors = electron_1.nativeTheme.shouldUseHighContrastColors;
electronSocket.emit('nativeTheme-shouldUseHighContrastColors-completed', shouldUseHighContrastColors);
});
socket.on('nativeTheme-shouldUseInvertedColorScheme', () => {
const shouldUseInvertedColorScheme = electron_1.nativeTheme.shouldUseInvertedColorScheme;
electronSocket.emit('nativeTheme-shouldUseInvertedColorScheme-completed', shouldUseInvertedColorScheme);
});
socket.on('nativeTheme-themeSource-get', () => {
const themeSource = electron_1.nativeTheme.themeSource;
electronSocket.emit('nativeTheme-themeSource-getCompleted', themeSource);
});
socket.on('nativeTheme-themeSource', (themeSource) => {
electron_1.nativeTheme.themeSource = themeSource;
});
socket.on('register-nativeTheme-updated-event', (id) => {
electron_1.nativeTheme.on('updated', () => {
electronSocket.emit('nativeTheme-updated' + id);
});
});
};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ACnD,sBAAW,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;YAC3B,cAAc,CAAC,IAAI,CAAC,qBAAqB,GAAG,EAAE,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}

View File

@@ -0,0 +1,40 @@
import { nativeTheme } from 'electron';
let electronSocket;
export = (socket: SocketIO.Socket) => {
electronSocket = socket;
socket.on('nativeTheme-shouldUseDarkColors', () => {
const shouldUseDarkColors = nativeTheme.shouldUseDarkColors;
electronSocket.emit('nativeTheme-shouldUseDarkColors-completed', shouldUseDarkColors);
});
socket.on('nativeTheme-shouldUseHighContrastColors', () => {
const shouldUseHighContrastColors = nativeTheme.shouldUseHighContrastColors;
electronSocket.emit('nativeTheme-shouldUseHighContrastColors-completed', shouldUseHighContrastColors);
});
socket.on('nativeTheme-shouldUseInvertedColorScheme', () => {
const shouldUseInvertedColorScheme = nativeTheme.shouldUseInvertedColorScheme;
electronSocket.emit('nativeTheme-shouldUseInvertedColorScheme-completed', shouldUseInvertedColorScheme);
});
socket.on('nativeTheme-themeSource-get', () => {
const themeSource = nativeTheme.themeSource;
electronSocket.emit('nativeTheme-themeSource-getCompleted', themeSource);
});
socket.on('nativeTheme-themeSource', (themeSource) => {
nativeTheme.themeSource = themeSource;
});
socket.on('register-nativeTheme-updated-event', (id) => {
nativeTheme.on('updated', () => {
electronSocket.emit('nativeTheme-updated' + id);
});
});
};

View File

@@ -0,0 +1,42 @@
"use strict";
const electron_1 = require("electron");
let electronSocket;
module.exports = (socket) => {
electronSocket = socket;
socket.on('register-pm-lock-screen', () => {
electron_1.powerMonitor.on('lock-screen', () => {
electronSocket.emit('pm-lock-screen');
});
});
socket.on('register-pm-unlock-screen', () => {
electron_1.powerMonitor.on('unlock-screen', () => {
electronSocket.emit('pm-unlock-screen');
});
});
socket.on('register-pm-suspend', () => {
electron_1.powerMonitor.on('suspend', () => {
electronSocket.emit('pm-suspend');
});
});
socket.on('register-pm-resume', () => {
electron_1.powerMonitor.on('resume', () => {
electronSocket.emit('pm-resume');
});
});
socket.on('register-pm-on-ac', () => {
electron_1.powerMonitor.on('on-ac', () => {
electronSocket.emit('pm-on-ac');
});
});
socket.on('register-pm-on-battery', () => {
electron_1.powerMonitor.on('on-battery', () => {
electronSocket.emit('pm-on-battery');
});
});
socket.on('register-pm-shutdown', () => {
electron_1.powerMonitor.on('shutdown', () => {
electronSocket.emit('pm-shutdown');
});
});
};
//# sourceMappingURL=powerMonitor.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"powerMonitor.js","sourceRoot":"","sources":["powerMonitor.ts"],"names":[],"mappings":";AAAA,uCAAwC;AACxC,IAAI,cAAc,CAAC;AAEnB,iBAAS,CAAC,MAAuB,EAAE,EAAE;IACjC,cAAc,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACtC,uBAAY,CAAC,EAAE,CAAC,aAAa,EAAE,GAAG,EAAE;YAChC,cAAc,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACxC,uBAAY,CAAC,EAAE,CAAC,eAAe,EAAE,GAAG,EAAE;YAClC,cAAc,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE;QAClC,uBAAY,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;YAC5B,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,EAAE,CAAC,oBAAoB,EAAE,GAAG,EAAE;QACjC,uBAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;YAC3B,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE;QAChC,uBAAY,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YAC1B,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;QACrC,uBAAY,CAAC,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;YAC/B,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE;QACnC,uBAAY,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE;YAC7B,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}

View File

@@ -0,0 +1,41 @@
import { powerMonitor } from 'electron';
let electronSocket;
export = (socket: SocketIO.Socket) => {
electronSocket = socket;
socket.on('register-pm-lock-screen', () => {
powerMonitor.on('lock-screen', () => {
electronSocket.emit('pm-lock-screen');
});
});
socket.on('register-pm-unlock-screen', () => {
powerMonitor.on('unlock-screen', () => {
electronSocket.emit('pm-unlock-screen');
});
});
socket.on('register-pm-suspend', () => {
powerMonitor.on('suspend', () => {
electronSocket.emit('pm-suspend');
});
});
socket.on('register-pm-resume', () => {
powerMonitor.on('resume', () => {
electronSocket.emit('pm-resume');
});
});
socket.on('register-pm-on-ac', () => {
powerMonitor.on('on-ac', () => {
electronSocket.emit('pm-on-ac');
});
});
socket.on('register-pm-on-battery', () => {
powerMonitor.on('on-battery', () => {
electronSocket.emit('pm-on-battery');
});
});
socket.on('register-pm-shutdown', () => {
powerMonitor.on('shutdown', () => {
electronSocket.emit('pm-shutdown');
});
});
};

View File

@@ -4,31 +4,29 @@ let electronSocket;
module.exports = (socket) => {
electronSocket = socket;
socket.on('shell-showItemInFolder', (fullPath) => {
const success = electron_1.shell.showItemInFolder(fullPath);
electronSocket.emit('shell-showItemInFolderCompleted', success);
electron_1.shell.showItemInFolder(fullPath);
electronSocket.emit('shell-showItemInFolderCompleted');
});
socket.on('shell-openItem', (fullPath) => {
const success = electron_1.shell.openItem(fullPath);
electronSocket.emit('shell-openItemCompleted', success);
socket.on('shell-openPath', async (path) => {
const errorMessage = await electron_1.shell.openPath(path);
electronSocket.emit('shell-openPathCompleted', errorMessage);
});
socket.on('shell-openExternal', (url, options) => {
let success = true;
socket.on('shell-openExternal', async (url, options) => {
let result = "";
if (options) {
electron_1.shell.openExternal(url, options).catch((error) => {
success = false;
electronSocket.emit('shell-openExternalCallback', [url, error]);
await electron_1.shell.openExternal(url, options).catch(e => {
result = e.message;
});
}
else {
electron_1.shell.openExternal(url).catch((error) => {
success = false;
electronSocket.emit('shell-openExternalCallback', [url, error]);
await electron_1.shell.openExternal(url).catch((e) => {
result = e.message;
});
}
electronSocket.emit('shell-openExternalCompleted', success);
electronSocket.emit('shell-openExternalCompleted', result);
});
socket.on('shell-moveItemToTrash', (fullPath) => {
const success = electron_1.shell.moveItemToTrash(fullPath);
socket.on('shell-moveItemToTrash', (fullPath, deleteOnFail) => {
const success = electron_1.shell.moveItemToTrash(fullPath, deleteOnFail);
electronSocket.emit('shell-moveItemToTrashCompleted', success);
});
socket.on('shell-beep', () => {

View File

@@ -1 +1 @@
{"version":3,"file":"shell.js","sourceRoot":"","sources":["shell.ts"],"names":[],"mappings":";AAAA,uCAAiC;AACjC,IAAI,cAAc,CAAC;AAEnB,iBAAS,CAAC,MAAuB,EAAE,EAAE;IACjC,cAAc,GAAG,MAAM,CAAC;IACxB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AC,iBAAiB,CAAC,YAAY,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAE1E,cAAc,CAAC,IAAI,CAAC,kCAAkC,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,wBAAwB,EAAE,CAAC,YAAY,EAAE,EAAE;QACjD,MAAM,eAAe,GAAG,gBAAK,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;QAE7D,cAAc,CAAC,IAAI,CAAC,iCAAiC,EAAE,eAAe,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}

View File

@@ -4,37 +4,36 @@ let electronSocket;
export = (socket: SocketIO.Socket) => {
electronSocket = socket;
socket.on('shell-showItemInFolder', (fullPath) => {
const success = shell.showItemInFolder(fullPath);
shell.showItemInFolder(fullPath);
electronSocket.emit('shell-showItemInFolderCompleted', success);
electronSocket.emit('shell-showItemInFolderCompleted');
});
socket.on('shell-openItem', (fullPath) => {
const success = shell.openItem(fullPath);
socket.on('shell-openPath', async (path) => {
const errorMessage = await shell.openPath(path);
electronSocket.emit('shell-openItemCompleted', success);
electronSocket.emit('shell-openPathCompleted', errorMessage);
});
socket.on('shell-openExternal', (url, options) => {
let success = true;
socket.on('shell-openExternal', async (url, options) => {
let result = "";
if (options) {
shell.openExternal(url, options).catch((error) => {
success = false;
electronSocket.emit('shell-openExternalCallback', [url, error]);
});
} else {
shell.openExternal(url).catch((error) => {
success = false;
electronSocket.emit('shell-openExternalCallback', [url, error]);
await shell.openExternal(url, options).catch(e => {
result = e.message;
});
}
else {
await shell.openExternal(url).catch((e) => {
result = e.message;
});
}
electronSocket.emit('shell-openExternalCompleted', success);
electronSocket.emit('shell-openExternalCompleted', result);
});
socket.on('shell-moveItemToTrash', (fullPath) => {
const success = shell.moveItemToTrash(fullPath);
socket.on('shell-moveItemToTrash', (fullPath, deleteOnFail) => {
const success = shell.moveItemToTrash(fullPath, deleteOnFail);
electronSocket.emit('shell-moveItemToTrashCompleted', success);
});
@@ -54,4 +53,4 @@ export = (socket: SocketIO.Socket) => {
electronSocket.emit('shell-readShortcutLinkCompleted', shortcutDetails);
});
};
};

View File

@@ -47,13 +47,15 @@ module.exports = (socket) => {
}
});
socket.on('create-tray', (image, menuItems) => {
const menu = electron_1.Menu.buildFromTemplate(menuItems);
addMenuItemClickConnector(menu.items, (id) => {
electronSocket.emit('trayMenuItemClicked', id);
});
const trayIcon = electron_1.nativeImage.createFromPath(image);
tray = new electron_1.Tray(trayIcon);
tray.setContextMenu(menu);
if (menuItems) {
const menu = electron_1.Menu.buildFromTemplate(menuItems);
addMenuItemClickConnector(menu.items, (id) => {
electronSocket.emit('trayMenuItemClicked', id);
});
tray.setContextMenu(menu);
}
});
socket.on('tray-destroy', () => {
if (tray) {

View File

@@ -1 +1 @@
{"version":3,"file":"tray.js","sourceRoot":"","sources":["tray.ts"],"names":[],"mappings":";AAAA,uCAAmD;AACnD,IAAI,IAAmB,CAAC;AACxB,IAAI,cAAc,CAAC;AAEnB,iBAAS,CAAC,MAAuB,EAAE,EAAE;IACjC,cAAc,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,qBAAqB,EAAE,CAAC,EAAE,EAAE,EAAE;QACpC,IAAI,IAAI,EAAE;YACN,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;gBAC/B,cAAc,CAAC,IAAI,CAAC,kBAAkB,GAAG,EAAE,EAAE,CAAO,KAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;YACnF,CAAC,CAAC,CAAC;SACN;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,2BAA2B,EAAE,CAAC,EAAE,EAAE,EAAE;QAC1C,IAAI,IAAI,EAAE;YACN,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;gBACrC,cAAc,CA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AAC,SAAS,EAAE,QAAQ;QAClD,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACvB,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC/C,yBAAyB,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;aAC3D;YAED,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,EAAE,EAAE;gBACzB,IAAI,CAAC,KAAK,GAAG,GAAG,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;aAC7C;QACL,CAAC,CAAC,CAAC;IACP,CAAC;AACL,CAAC,CAAC"}

View File

@@ -53,16 +53,18 @@ export = (socket: SocketIO.Socket) => {
});
socket.on('create-tray', (image, menuItems) => {
const menu = Menu.buildFromTemplate(menuItems);
addMenuItemClickConnector(menu.items, (id) => {
electronSocket.emit('trayMenuItemClicked', id);
});
const trayIcon = nativeImage.createFromPath(image);
tray = new Tray(trayIcon);
tray.setContextMenu(menu);
if (menuItems) {
const menu = Menu.buildFromTemplate(menuItems);
addMenuItemClickConnector(menu.items, (id) => {
electronSocket.emit('trayMenuItemClicked', id);
});
tray.setContextMenu(menu);
}
});
socket.on('tray-destroy', () => {

View File

@@ -136,6 +136,33 @@ module.exports = (socket) => {
const browserWindow = getWindowById(id);
browserWindow.webContents.session.setUserAgent(userAgent, acceptLanguages);
});
socket.on('register-webContents-session-cookies-changed', (id) => {
const browserWindow = getWindowById(id);
browserWindow.webContents.session.cookies.removeAllListeners('changed');
browserWindow.webContents.session.cookies.on('changed', (event, cookie, cause, removed) => {
electronSocket.emit('webContents-session-cookies-changed' + id, [cookie, cause, removed]);
});
});
socket.on('webContents-session-cookies-get', async (id, filter, guid) => {
const browserWindow = getWindowById(id);
const cookies = await browserWindow.webContents.session.cookies.get(filter);
electronSocket.emit('webContents-session-cookies-get-completed' + guid, cookies);
});
socket.on('webContents-session-cookies-set', async (id, details, guid) => {
const browserWindow = getWindowById(id);
await browserWindow.webContents.session.cookies.set(details);
electronSocket.emit('webContents-session-cookies-set-completed' + guid);
});
socket.on('webContents-session-cookies-remove', async (id, url, name, guid) => {
const browserWindow = getWindowById(id);
await browserWindow.webContents.session.cookies.remove(url, name);
electronSocket.emit('webContents-session-cookies-remove-completed' + guid);
});
socket.on('webContents-session-cookies-flushStore', async (id, guid) => {
const browserWindow = getWindowById(id);
await browserWindow.webContents.session.cookies.flushStore();
electronSocket.emit('webContents-session-cookies-flushStore-completed' + guid);
});
socket.on('webContents-loadURL', (id, url, options) => {
const browserWindow = getWindowById(id);
browserWindow.webContents.loadURL(url, options).then(() => {

File diff suppressed because one or more lines are too long

View File

@@ -174,6 +174,43 @@ export = (socket: SocketIO.Socket) => {
browserWindow.webContents.session.setUserAgent(userAgent, acceptLanguages);
});
socket.on('register-webContents-session-cookies-changed', (id) => {
const browserWindow = getWindowById(id);
browserWindow.webContents.session.cookies.removeAllListeners('changed');
browserWindow.webContents.session.cookies.on('changed', (event, cookie, cause, removed) => {
electronSocket.emit('webContents-session-cookies-changed' + id, [cookie, cause, removed]);
});
});
socket.on('webContents-session-cookies-get', async (id, filter, guid) => {
const browserWindow = getWindowById(id);
const cookies = await browserWindow.webContents.session.cookies.get(filter);
electronSocket.emit('webContents-session-cookies-get-completed' + guid, cookies);
});
socket.on('webContents-session-cookies-set', async (id, details, guid) => {
const browserWindow = getWindowById(id);
await browserWindow.webContents.session.cookies.set(details);
electronSocket.emit('webContents-session-cookies-set-completed' + guid);
});
socket.on('webContents-session-cookies-remove', async (id, url, name, guid) => {
const browserWindow = getWindowById(id);
await browserWindow.webContents.session.cookies.remove(url, name);
electronSocket.emit('webContents-session-cookies-remove-completed' + guid);
});
socket.on('webContents-session-cookies-flushStore', async (id, guid) => {
const browserWindow = getWindowById(id);
await browserWindow.webContents.session.cookies.flushStore();
electronSocket.emit('webContents-session-cookies-flushStore-completed' + guid);
});
socket.on('webContents-loadURL', (id, url, options) => {
const browserWindow = getWindowById(id);
browserWindow.webContents.loadURL(url, options).then(() => {

View File

@@ -6,6 +6,7 @@
"name": "{{executable}}",
"author": "",
"singleInstance": false,
"environment": "Production",
"build": {
"appId": "com.{{executable}}.app",
"productName": "{{executable}}",
@@ -19,14 +20,14 @@
{
"from": "./bin",
"to": "bin",
"filter": ["**/*"]
"filter": [ "**/*" ]
}
],
"files": [
{
"from": "./ElectronHostHook/node_modules",
"to": "ElectronHostHook/node_modules",
"filter": ["**/*"]
"filter": [ "**/*" ]
},
"**/*"
]

View File

@@ -8,8 +8,10 @@ let io, server, browserWindows, ipc, apiProcess, loadURL;
let appApi, menu, dialogApi, notification, tray, webContents;
let globalShortcut, shellApi, screen, clipboard, autoUpdater;
let commandLine, browserView;
let powerMonitor;
let splashScreen, hostHook;
let mainWindowId;
let mainWindowId, nativeTheme;
let dock;
let manifestJsonFileName = 'electron.manifest.json';
let watchable = false;
@@ -61,6 +63,11 @@ app.on('ready', () => {
});
app.on('quit', async (event, exitCode) => {
await server.close();
apiProcess.kill();
});
function isSplashScreenEnabled() {
if (manifestJsonFile.hasOwnProperty('splashscreen')) {
if (manifestJsonFile.splashscreen.hasOwnProperty('imageFile')) {
@@ -135,8 +142,8 @@ function startSocketApiBridge(port) {
// we need to remove previously cache instances
// otherwise it will fire the same event multiple depends how many time
// live reload watch happen.
socket.on('disconnect', function () {
console.log('Got disconnect!');
socket.on('disconnect', function (reason) {
console.log('Got disconnect! Reason: ' + reason);
delete require.cache[require.resolve('./api/app')];
delete require.cache[require.resolve('./api/browserWindows')];
delete require.cache[require.resolve('./api/commandLine')];
@@ -152,6 +159,9 @@ function startSocketApiBridge(port) {
delete require.cache[require.resolve('./api/screen')];
delete require.cache[require.resolve('./api/clipboard')];
delete require.cache[require.resolve('./api/browserView')];
delete require.cache[require.resolve('./api/powerMonitor')];
delete require.cache[require.resolve('./api/nativeTheme')];
delete require.cache[require.resolve('./api/dock')];
});
global['electronsocket'] = socket;
@@ -173,8 +183,9 @@ function startSocketApiBridge(port) {
screen = require('./api/screen')(socket);
clipboard = require('./api/clipboard')(socket);
browserView = require('./api/browserView')(socket);
powerMonitor = require('./api/powerMonitor')(socket);
nativeTheme = require('./api/nativeTheme')(socket);
dock = require('./api/dock')(socket);
try {
const hostHookScriptFilePath = path.join(__dirname, 'ElectronHostHook', 'index.js');
@@ -211,7 +222,7 @@ function startAspCoreBackend(electronPort) {
function startBackend(aspCoreBackendPort) {
console.log('ASP.NET Core Port: ' + aspCoreBackendPort);
loadURL = `http://localhost:${aspCoreBackendPort}`;
const parameters = [`/electronPort=${electronPort}`, `/electronWebPort=${aspCoreBackendPort}`];
const parameters = [getEnvironmentParameter(), `/electronPort=${electronPort}`, `/electronWebPort=${aspCoreBackendPort}`];
let binaryFile = manifestJsonFile.executable;
const os = require('os');
@@ -242,7 +253,7 @@ function startAspCoreBackendWithWatch(electronPort) {
function startBackend(aspCoreBackendPort) {
console.log('ASP.NET Core Watch Port: ' + aspCoreBackendPort);
loadURL = `http://localhost:${aspCoreBackendPort}`;
const parameters = ['watch', 'run', `/electronPort=${electronPort}`, `/electronWebPort=${aspCoreBackendPort}`];
const parameters = ['watch', 'run', getEnvironmentParameter(), `/electronPort=${electronPort}`, `/electronWebPort=${aspCoreBackendPort}`];
var options = {
cwd: currentBinPath,
@@ -254,4 +265,12 @@ function startAspCoreBackendWithWatch(electronPort) {
console.log(`stdout: ${data.toString()}`);
});
}
}
function getEnvironmentParameter() {
if(manifestJsonFile.environment) {
return '--environment=' + manifestJsonFile.environment;
}
return '';
}

View File

@@ -89,9 +89,9 @@
}
},
"@electron/get": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/@electron/get/-/get-1.10.0.tgz",
"integrity": "sha512-hlueNXU51c3CwQjBw/i5fwt+VfQgSQVUTdicpCHkhEjNZaa4CXJ5W1GaxSwtLE2dvRmAHjpIjUMHTqJ53uojfg==",
"version": "1.12.2",
"resolved": "https://registry.npmjs.org/@electron/get/-/get-1.12.2.tgz",
"integrity": "sha512-vAuHUbfvBQpYTJ5wB7uVIDq5c/Ry0fiTBMs7lnEYAo/qXXppIVcWdfBr57u6eRnKdVso7KSiH6p/LbQAG6Izrg==",
"dev": true,
"requires": {
"debug": "^4.1.1",
@@ -123,22 +123,14 @@
"@types/node": {
"version": "10.17.20",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.20.tgz",
"integrity": "sha512-XgDgo6W10SeGEAM0k7FosJpvLCynOTYns4Xk3J5HGrA+UI/bKZ30PGMzOP5Lh2zs4259I71FSYLAtjnx3qhObw==",
"dev": true
"integrity": "sha512-XgDgo6W10SeGEAM0k7FosJpvLCynOTYns4Xk3J5HGrA+UI/bKZ30PGMzOP5Lh2zs4259I71FSYLAtjnx3qhObw=="
},
"@types/semver": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.1.0.tgz",
"integrity": "sha512-pOKLaubrAEMUItGNpgwl0HMFPrSAFic8oSVIvfu1UwcgGNmNyK9gyhBHKmBnUTwwVvpZfkzUC0GaMgnL6P86uA==",
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.2.0.tgz",
"integrity": "sha512-TbB0A8ACUWZt3Y6bQPstW9QNbhNeebdgLX4T/ZfkrswAfUzRiXrgd9seol+X379Wa589Pu4UEx9Uok0D4RjRCQ==",
"requires": {
"@types/node": "*"
},
"dependencies": {
"@types/node": {
"version": "13.13.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.0.tgz",
"integrity": "sha512-WE4IOAC6r/yBZss1oQGM5zs2D7RuKR6Q+w+X2SouPofnWn+LbCqClRyhO3ZE7Ix8nmFgo/oVuuE01cJT2XB13A=="
}
}
},
"@types/socket.io": {
@@ -190,6 +182,11 @@
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
"integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="
},
"at-least-node": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
"integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg=="
},
"backo2": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz",
@@ -207,9 +204,9 @@
"integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg="
},
"base64id": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz",
"integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog=="
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz",
"integrity": "sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY="
},
"better-assert": {
"version": "1.0.2",
@@ -254,9 +251,9 @@
"dev": true
},
"builder-util-runtime": {
"version": "8.6.2",
"resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-8.6.2.tgz",
"integrity": "sha512-9QnIBISfhgQ2BxtRLidVqf/v5HD73vSKZDllpUmGd2L6VORGQk7cZAPmPtw4HQM3gPBelyVJ5yIjMNZ8xjmd1A==",
"version": "8.7.0",
"resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-8.7.0.tgz",
"integrity": "sha512-G1AqqVM2vYTrSFR982c1NNzwXKrGLQjVjaZaWQdn4O6Z3YKjdMDofw88aD9jpyK9ZXkrCxR0tI3Qe9wNbyTlXg==",
"requires": {
"debug": "^4.1.1",
"sax": "^1.2.4"
@@ -440,9 +437,9 @@
"dev": true
},
"electron": {
"version": "8.2.3",
"resolved": "https://registry.npmjs.org/electron/-/electron-8.2.3.tgz",
"integrity": "sha512-FJUp103c8yJBoAaj/QM/OBde57iJh95u1yGJBytMUXmLFSsx78LmNE03QN4XCODyzi76IEcasvUcK6scogRLbQ==",
"version": "9.0.5",
"resolved": "https://registry.npmjs.org/electron/-/electron-9.0.5.tgz",
"integrity": "sha512-bnL9H48LuQ250DML8xUscsKiuSu+xv5umXbpBXYJ0BfvYVmFfNbG3jCfhrsH7aP6UcQKVxOG1R/oQExd0EFneQ==",
"dev": true,
"requires": {
"@electron/get": "^1.0.1",
@@ -451,26 +448,52 @@
},
"dependencies": {
"@types/node": {
"version": "12.12.36",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.36.tgz",
"integrity": "sha512-hmmypvyO/uTLFYCYu6Hlb3ydeJ11vXRxg8/WJ0E3wvwmPO0y47VqnfmXFVuWlysO0Zyj+je1Y33rQeuYkZ51GQ==",
"version": "12.12.47",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.47.tgz",
"integrity": "sha512-yzBInQFhdY8kaZmqoL2+3U5dSTMrKaYcb561VU+lDzAYvqt+2lojvBEy+hmpSNuXnPTx7m9+04CzWYOUqWME2A==",
"dev": true
}
}
},
"electron-updater": {
"version": "4.2.5",
"resolved": "https://registry.npmjs.org/electron-updater/-/electron-updater-4.2.5.tgz",
"integrity": "sha512-ir8SI3capF5pN4LTQY79bP7oqiBKjgtdDW378xVId5VcGUZ+Toei2j+fgx1mq3y4Qg19z4HqLxEZ9FqMD0T0RA==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/electron-updater/-/electron-updater-4.3.1.tgz",
"integrity": "sha512-UDC5AHCgeiHJYDYWZG/rsl1vdAFKqI/Lm7whN57LKAk8EfhTewhcEHzheRcncLgikMcQL8gFo1KeX51tf5a5Wg==",
"requires": {
"@types/semver": "^7.1.0",
"builder-util-runtime": "8.6.2",
"fs-extra": "^8.1.0",
"builder-util-runtime": "8.7.0",
"fs-extra": "^9.0.0",
"js-yaml": "^3.13.1",
"lazy-val": "^1.0.4",
"lodash.isequal": "^4.5.0",
"pako": "^1.0.11",
"semver": "^7.1.3"
},
"dependencies": {
"fs-extra": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.0.tgz",
"integrity": "sha512-pmEYSk3vYsG/bF651KPUXZ+hvjpgWYw/Gc7W9NFUe3ZVLczKKWIij3IKpOrQcdw4TILtibFslZ0UmR8Vvzig4g==",
"requires": {
"at-least-node": "^1.0.0",
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
"universalify": "^1.0.0"
}
},
"jsonfile": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz",
"integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==",
"requires": {
"graceful-fs": "^4.1.6",
"universalify": "^1.0.0"
}
},
"universalify": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz",
"integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug=="
}
}
},
"encodeurl": {
@@ -490,27 +513,42 @@
}
},
"engine.io": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.4.1.tgz",
"integrity": "sha512-8MfIfF1/IIfxuc2gv5K+XlFZczw/BpTvqBdl0E2fBLkYQp4miv4LuDTVtYt4yMyaIFLEr4vtaSgV4mjvll8Crw==",
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.3.2.tgz",
"integrity": "sha512-AsaA9KG7cWPXWHp5FvHdDWY3AMWeZ8x+2pUVLcn71qE5AtAzgGbxuclOytygskw8XGmiQafTmnI9Bix3uihu2w==",
"requires": {
"accepts": "~1.3.4",
"base64id": "2.0.0",
"base64id": "1.0.0",
"cookie": "0.3.1",
"debug": "~4.1.0",
"engine.io-parser": "~2.2.0",
"ws": "^7.1.2"
"debug": "~3.1.0",
"engine.io-parser": "~2.1.0",
"ws": "~6.1.0"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
}
}
},
"engine.io-client": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.4.1.tgz",
"integrity": "sha512-RJNmA+A9Js+8Aoq815xpGAsgWH1VoSYM//2VgIiu9lNOaHFfLpTjH4tOzktBpjIs5lvOfiNY1dwf+NuU6D38Mw==",
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.3.2.tgz",
"integrity": "sha512-y0CPINnhMvPuwtqXfsGuWE8BB66+B6wTtCofQDRecMQPYX3MYUZXFNKDhdrSe3EVjgOu4V3rxdeqN/Tr91IgbQ==",
"requires": {
"component-emitter": "1.2.1",
"component-inherit": "0.0.3",
"debug": "~4.1.0",
"engine.io-parser": "~2.2.0",
"debug": "~3.1.0",
"engine.io-parser": "~2.1.1",
"has-cors": "1.1.0",
"indexof": "0.0.1",
"parseqs": "0.0.5",
@@ -520,20 +558,25 @@
"yeast": "0.1.2"
},
"dependencies": {
"ws": {
"version": "6.1.4",
"resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz",
"integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==",
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"async-limiter": "~1.0.0"
"ms": "2.0.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
}
}
},
"engine.io-parser": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.0.tgz",
"integrity": "sha512-6I3qD9iUxotsC5HEMuuGsKA0cXerGz+4uGcXQEkfBidgKf0amsjrrtwcbwK/nzpZBxclXlV7gGl9dgWvu4LF6w==",
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.1.3.tgz",
"integrity": "sha512-6HXPre2O4Houl7c4g7Ic/XzPnHBvaEmN90vtRO9uLmwtRqQmTOw0QMevL1TOfL2Cpu1VzsaTmMotQgMdkzGkVA==",
"requires": {
"after": "0.8.2",
"arraybuffer.slice": "~0.0.7",
@@ -556,9 +599,9 @@
"optional": true
},
"escape-string-regexp": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
"integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==",
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
"dev": true,
"optional": true
},
@@ -609,6 +652,7 @@
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
"integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
"dev": true,
"requires": {
"graceful-fs": "^4.2.0",
"jsonfile": "^4.0.0",
@@ -645,19 +689,19 @@
}
},
"global-agent": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/global-agent/-/global-agent-2.1.8.tgz",
"integrity": "sha512-VpBe/rhY6Rw2VDOTszAMNambg+4Qv8j0yiTNDYEXXXxkUNGWLHp8A3ztK4YDBbFNcWF4rgsec6/5gPyryya/+A==",
"version": "2.1.12",
"resolved": "https://registry.npmjs.org/global-agent/-/global-agent-2.1.12.tgz",
"integrity": "sha512-caAljRMS/qcDo69X9BfkgrihGUgGx44Fb4QQToNQjsiWh+YlQ66uqYVAdA8Olqit+5Ng0nkz09je3ZzANMZcjg==",
"dev": true,
"optional": true,
"requires": {
"boolean": "^3.0.0",
"core-js": "^3.6.4",
"boolean": "^3.0.1",
"core-js": "^3.6.5",
"es6-error": "^4.1.1",
"matcher": "^2.1.0",
"roarr": "^2.15.2",
"semver": "^7.1.2",
"serialize-error": "^5.0.0"
"matcher": "^3.0.0",
"roarr": "^2.15.3",
"semver": "^7.3.2",
"serialize-error": "^7.0.1"
}
},
"global-tunnel-ng": {
@@ -804,6 +848,7 @@
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
"dev": true,
"requires": {
"graceful-fs": "^4.1.6"
}
@@ -844,26 +889,26 @@
"dev": true
},
"matcher": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/matcher/-/matcher-2.1.0.tgz",
"integrity": "sha512-o+nZr+vtJtgPNklyeUKkkH42OsK8WAfdgaJE2FNxcjLPg+5QbeEoT6vRj8Xq/iv18JlQ9cmKsEu0b94ixWf1YQ==",
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz",
"integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==",
"dev": true,
"optional": true,
"requires": {
"escape-string-regexp": "^2.0.0"
"escape-string-regexp": "^4.0.0"
}
},
"mime-db": {
"version": "1.43.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz",
"integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ=="
"version": "1.44.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
"integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg=="
},
"mime-types": {
"version": "2.1.26",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz",
"integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==",
"version": "2.1.27",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
"integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
"requires": {
"mime-db": "1.43.0"
"mime-db": "1.44.0"
}
},
"mimic-response": {
@@ -950,11 +995,6 @@
"integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==",
"dev": true
},
"pako": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
},
"parseqs": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz",
@@ -1138,26 +1178,26 @@
"optional": true
},
"serialize-error": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-5.0.0.tgz",
"integrity": "sha512-/VtpuyzYf82mHYTtI4QKtwHa79vAdU5OQpNPAmE/0UDdlGT0ZxHwC+J6gXkw29wwoVI8fMPsfcVHOwXtUQYYQA==",
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz",
"integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==",
"dev": true,
"optional": true,
"requires": {
"type-fest": "^0.8.0"
"type-fest": "^0.13.1"
}
},
"socket.io": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.3.0.tgz",
"integrity": "sha512-2A892lrj0GcgR/9Qk81EaY2gYhCBxurV0PfmmESO6p27QPrUK1J3zdns+5QPqvUYK2q657nSj0guoIil9+7eFg==",
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.2.0.tgz",
"integrity": "sha512-wxXrIuZ8AILcn+f1B4ez4hJTPG24iNgxBBDaJfT6MsyOhVYiTXWexGoPkd87ktJG8kQEcL/NBvRi64+9k4Kc0w==",
"requires": {
"debug": "~4.1.0",
"engine.io": "~3.4.0",
"engine.io": "~3.3.1",
"has-binary2": "~1.0.2",
"socket.io-adapter": "~1.1.0",
"socket.io-client": "2.3.0",
"socket.io-parser": "~3.4.0"
"socket.io-client": "2.2.0",
"socket.io-parser": "~3.3.0"
}
},
"socket.io-adapter": {
@@ -1166,16 +1206,16 @@
"integrity": "sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g=="
},
"socket.io-client": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.3.0.tgz",
"integrity": "sha512-cEQQf24gET3rfhxZ2jJ5xzAOo/xhZwK+mOqtGRg5IowZsMgwvHwnf/mCRapAAkadhM26y+iydgwsXGObBB5ZdA==",
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.2.0.tgz",
"integrity": "sha512-56ZrkTDbdTLmBIyfFYesgOxsjcLnwAKoN4CiPyTVkMQj3zTUh0QAx3GbvIvLpFEOvQWu92yyWICxB0u7wkVbYA==",
"requires": {
"backo2": "1.0.2",
"base64-arraybuffer": "0.1.5",
"component-bind": "1.0.0",
"component-emitter": "1.2.1",
"debug": "~4.1.0",
"engine.io-client": "~3.4.0",
"debug": "~3.1.0",
"engine.io-client": "~3.3.1",
"has-binary2": "~1.0.2",
"has-cors": "1.1.0",
"indexof": "0.0.1",
@@ -1186,41 +1226,44 @@
"to-array": "0.1.4"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"socket.io-parser": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.0.tgz",
"integrity": "sha512-hczmV6bDgdaEbVqhAeVMM/jfUfzuEZHsQg6eOmLgJht6G3mPKMxYm75w2+qhAQZ+4X+1+ATZ+QFKeOZD5riHng==",
"requires": {
"component-emitter": "1.2.1",
"debug": "~3.1.0",
"isarray": "2.0.1"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
}
}
}
}
}
},
"socket.io-parser": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.4.0.tgz",
"integrity": "sha512-/G/VOI+3DBp0+DJKW4KesGnQkQPFmUCbA/oO2QGT6CWxU7hLGWqU3tyuzeSK/dqcyeHsQg1vTe9jiZI8GU9SCQ==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.0.tgz",
"integrity": "sha512-hczmV6bDgdaEbVqhAeVMM/jfUfzuEZHsQg6eOmLgJht6G3mPKMxYm75w2+qhAQZ+4X+1+ATZ+QFKeOZD5riHng==",
"requires": {
"component-emitter": "1.2.1",
"debug": "~4.1.0",
"debug": "~3.1.0",
"isarray": "2.0.1"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
}
}
},
"sprintf-js": {
@@ -1374,9 +1417,9 @@
"optional": true
},
"type-fest": {
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
"integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==",
"version": "0.13.1",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz",
"integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==",
"dev": true,
"optional": true
},
@@ -1395,7 +1438,8 @@
"universalify": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg=="
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
"dev": true
},
"url-parse-lax": {
"version": "3.0.0",
@@ -1425,9 +1469,12 @@
"dev": true
},
"ws": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.2.3.tgz",
"integrity": "sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ=="
"version": "6.1.4",
"resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz",
"integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==",
"requires": {
"async-limiter": "~1.0.0"
}
},
"xmlhttprequest-ssl": {
"version": "1.5.5",

View File

@@ -13,7 +13,7 @@
},
"dependencies": {
"dasherize": "^2.0.0",
"electron-updater": "^4.2.5",
"electron-updater": "^4.3.1",
"image-size": "^0.7.4",
"portscanner": "^2.2.0",
"socket.io": "^2.2.0"
@@ -21,7 +21,7 @@
"devDependencies": {
"@types/node": "^10.14.4",
"@types/socket.io": "^2.1.2",
"electron": "^8.2.3",
"electron": "^9.0.5",
"tslint": "^6.1.1",
"typescript": "^3.8.3"
}

View File

@@ -21,7 +21,7 @@ namespace ElectronNET.WebApp.Controllers
Electron.IpcMain.On("sys-info", async (args) =>
{
string homePath = await Electron.App.GetPathAsync(PathName.home);
string homePath = await Electron.App.GetPathAsync(PathName.Home);
var mainWindow = Electron.WindowManager.BrowserWindows.First();
Electron.IpcMain.Send(mainWindow, "got-sys-info", homePath);

View File

@@ -1,4 +1,6 @@
using Microsoft.AspNetCore.Mvc;
using ElectronNET.API;
using System;
namespace ElectronNET.WebApp.Controllers
{
@@ -6,6 +8,40 @@ namespace ElectronNET.WebApp.Controllers
{
public IActionResult Index()
{
if (HybridSupport.IsElectronActive)
{
Electron.PowerMonitor.OnLockScreen += () =>
{
Console.WriteLine("Screen Locked detected from C#");
};
Electron.PowerMonitor.OnUnLockScreen += () =>
{
Console.WriteLine("Screen unlocked detected from C# ");
};
Electron.PowerMonitor.OnSuspend += () =>
{
Console.WriteLine("The system is going to sleep");
};
Electron.PowerMonitor.OnResume += () =>
{
Console.WriteLine("The system is resuming");
};
Electron.PowerMonitor.OnAC += () =>
{
Console.WriteLine("The system changes to AC power");
};
Electron.PowerMonitor.OnBattery += () =>
{
Console.WriteLine("The system is about to change to battery power");
};
}
return View();
}
}

View File

@@ -11,6 +11,8 @@ namespace ElectronNET.WebApp.Controllers
{
if (HybridSupport.IsElectronActive)
{
Electron.App.Ready += () => CreateContextMenu();
var menu = new MenuItem[] {
new MenuItem { Label = "Edit", Submenu = new MenuItem[] {
new MenuItem { Label = "Undo", Accelerator = "CmdOrCtrl+Z", Role = MenuRole.undo },
@@ -93,7 +95,6 @@ namespace ElectronNET.WebApp.Controllers
Electron.Menu.SetApplicationMenu(menu);
CreateContextMenu();
}
return View();
@@ -113,12 +114,11 @@ namespace ElectronNET.WebApp.Controllers
};
var mainWindow = Electron.WindowManager.BrowserWindows.FirstOrDefault();
if (mainWindow == null) return;
Electron.Menu.SetContextMenu(mainWindow, menu);
Electron.IpcMain.On("show-context-menu", (args) =>
{
var mainWindow = Electron.WindowManager.BrowserWindows.FirstOrDefault();
Electron.Menu.ContextMenuPopup(mainWindow);
});
}

View File

@@ -18,7 +18,7 @@ namespace ElectronNET.WebApp.Controllers
var saveOptions = new SaveDialogOptions
{
Title = "Save an PDF-File",
DefaultPath = await Electron.App.GetPathAsync(PathName.documents),
DefaultPath = await Electron.App.GetPathAsync(PathName.Documents),
Filters = new FileFilter[]
{
new FileFilter { Name = "PDF", Extensions = new string[] { "pdf" } }

View File

@@ -12,7 +12,7 @@ namespace ElectronNET.WebApp.Controllers
{
Electron.IpcMain.On("open-file-manager", async (args) =>
{
string path = await Electron.App.GetPathAsync(PathName.home);
string path = await Electron.App.GetPathAsync(PathName.Home);
await Electron.Shell.ShowItemInFolderAsync(path);
});

View File

@@ -0,0 +1,723 @@
{
"name": "electron-host-hook",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@types/engine.io": {
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/@types/engine.io/-/engine.io-3.1.4.tgz",
"integrity": "sha512-98rXVukLD6/ozrQ2O80NAlWDGA4INg+tqsEReWJldqyi2fulC9V7Use/n28SWgROXKm6003ycWV4gZHoF8GA6w==",
"dev": true,
"requires": {
"@types/node": "*"
}
},
"@types/node": {
"version": "14.0.9",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.9.tgz",
"integrity": "sha512-0sCTiXKXELOBxvZLN4krQ0FPOAA7ij+6WwvD0k/PHd9/KAkr4dXel5J9fh6F4x1FwAQILqAWkmpeuS6mjf1iKA==",
"dev": true
},
"@types/socket.io": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/@types/socket.io/-/socket.io-2.1.8.tgz",
"integrity": "sha512-NIQfh9WwJuJKlgmby4NgwMpoBOmNPCDgaRNPiLYZBtkbHkszK/9R52B5yGkd5a34rbVdAADuo8FhOS/5AZDemw==",
"dev": true,
"requires": {
"@types/engine.io": "*",
"@types/node": "*"
}
},
"archiver": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/archiver/-/archiver-3.1.1.tgz",
"integrity": "sha512-5Hxxcig7gw5Jod/8Gq0OneVgLYET+oNHcxgWItq4TbhOzRLKNAFUb9edAftiMKXvXfCB0vbGrJdZDNq0dWMsxg==",
"requires": {
"archiver-utils": "^2.1.0",
"async": "^2.6.3",
"buffer-crc32": "^0.2.1",
"glob": "^7.1.4",
"readable-stream": "^3.4.0",
"tar-stream": "^2.1.0",
"zip-stream": "^2.1.2"
}
},
"archiver-utils": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-2.1.0.tgz",
"integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==",
"requires": {
"glob": "^7.1.4",
"graceful-fs": "^4.2.0",
"lazystream": "^1.0.0",
"lodash.defaults": "^4.2.0",
"lodash.difference": "^4.5.0",
"lodash.flatten": "^4.4.0",
"lodash.isplainobject": "^4.0.6",
"lodash.union": "^4.6.0",
"normalize-path": "^3.0.0",
"readable-stream": "^2.0.0"
},
"dependencies": {
"readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
}
}
},
"arguments-extended": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/arguments-extended/-/arguments-extended-0.0.3.tgz",
"integrity": "sha1-YQfkkX0OtvCk3WYyD8Fa/HLvSUY=",
"requires": {
"extended": "~0.0.3",
"is-extended": "~0.0.8"
}
},
"array-extended": {
"version": "0.0.11",
"resolved": "https://registry.npmjs.org/array-extended/-/array-extended-0.0.11.tgz",
"integrity": "sha1-1xRK50jek8pybxIQCdv/FibRZL0=",
"requires": {
"arguments-extended": "~0.0.3",
"extended": "~0.0.3",
"is-extended": "~0.0.3"
}
},
"async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"requires": {
"lodash": "^4.17.14"
}
},
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
},
"base64-js": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz",
"integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g=="
},
"big-integer": {
"version": "1.6.48",
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz",
"integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w=="
},
"binary": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz",
"integrity": "sha1-n2BVO8XOjDOG87VTz/R0Yq3sqnk=",
"requires": {
"buffers": "~0.1.1",
"chainsaw": "~0.1.0"
}
},
"bl": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/bl/-/bl-4.0.2.tgz",
"integrity": "sha512-j4OH8f6Qg2bGuWfRiltT2HYGx0e1QcBTrK9KAHNMwMZdQnDZFk0ZSYIpADjYCB3U12nicC5tVJwSIhwOWjb4RQ==",
"requires": {
"buffer": "^5.5.0",
"inherits": "^2.0.4",
"readable-stream": "^3.4.0"
}
},
"bluebird": {
"version": "3.4.7",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz",
"integrity": "sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM="
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"buffer": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz",
"integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==",
"requires": {
"base64-js": "^1.0.2",
"ieee754": "^1.1.4"
}
},
"buffer-crc32": {
"version": "0.2.13",
"resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
"integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI="
},
"buffer-indexof-polyfill": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.1.tgz",
"integrity": "sha1-qfuAbOgUXVQoUQznLyeLs2OmOL8="
},
"buffers": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz",
"integrity": "sha1-skV5w77U1tOWru5tmorn9Ugqt7s="
},
"chainsaw": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz",
"integrity": "sha1-XqtQsor+WAdNDVgpE4iCi15fvJg=",
"requires": {
"traverse": ">=0.3.0 <0.4"
}
},
"compress-commons": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-2.1.1.tgz",
"integrity": "sha512-eVw6n7CnEMFzc3duyFVrQEuY1BlHR3rYsSztyG32ibGMW722i3C6IizEGMFmfMU+A+fALvBIwxN3czffTcdA+Q==",
"requires": {
"buffer-crc32": "^0.2.13",
"crc32-stream": "^3.0.1",
"normalize-path": "^3.0.0",
"readable-stream": "^2.3.6"
},
"dependencies": {
"readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
}
}
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
},
"crc": {
"version": "3.8.0",
"resolved": "https://registry.npmjs.org/crc/-/crc-3.8.0.tgz",
"integrity": "sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==",
"requires": {
"buffer": "^5.1.0"
}
},
"crc32-stream": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-3.0.1.tgz",
"integrity": "sha512-mctvpXlbzsvK+6z8kJwSJ5crm7yBwrQMTybJzMw1O4lLGJqjlDCXY2Zw7KheiA6XBEcBmfLx1D88mjRGVJtY9w==",
"requires": {
"crc": "^3.4.4",
"readable-stream": "^3.4.0"
}
},
"date-extended": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/date-extended/-/date-extended-0.0.6.tgz",
"integrity": "sha1-I4AtV90b94GIE/4MMuhRqG2iZ8k=",
"requires": {
"array-extended": "~0.0.3",
"extended": "~0.0.3",
"is-extended": "~0.0.3"
}
},
"declare.js": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/declare.js/-/declare.js-0.0.8.tgz",
"integrity": "sha1-BHit/5VkwAT1Hfc9i8E0AZ0o3N4="
},
"duplexer2": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz",
"integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=",
"requires": {
"readable-stream": "^2.0.2"
},
"dependencies": {
"readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
}
}
},
"end-of-stream": {
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
"integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
"requires": {
"once": "^1.4.0"
}
},
"es6-promise": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz",
"integrity": "sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM="
},
"exceljs": {
"version": "1.15.0",
"resolved": "https://registry.npmjs.org/exceljs/-/exceljs-1.15.0.tgz",
"integrity": "sha512-72CySYLU1oBIixpBkWV0mR6YM+X8v2GyyWgKBovS9Hso0Ul7S3FtlWGeAifxB+lpzznokWMRDLMZ8EyS2tX6xg==",
"requires": {
"archiver": "^3.0.0",
"fast-csv": "^2.4.1",
"jszip": "^3.1.5",
"moment": "^2.22.2",
"promish": "^5.1.1",
"sax": "^1.2.4",
"tmp": "^0.1.0",
"unzipper": "^0.9.12"
}
},
"extended": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/extended/-/extended-0.0.6.tgz",
"integrity": "sha1-f7i/e52uOXWG5IVwrP1kLHjlBmk=",
"requires": {
"extender": "~0.0.5"
}
},
"extender": {
"version": "0.0.10",
"resolved": "https://registry.npmjs.org/extender/-/extender-0.0.10.tgz",
"integrity": "sha1-WJwHSCvmGhRgttgfnCSqZ+jzJM0=",
"requires": {
"declare.js": "~0.0.4"
}
},
"fast-csv": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/fast-csv/-/fast-csv-2.5.0.tgz",
"integrity": "sha512-M/9ezLU9/uDwvDZTt9sNFJa0iLDUsbhYJwPtnE0D9MjeuB6DY9wRCyUPZta9iI6cSz5wBWGaUPL61QH8h92cNA==",
"requires": {
"extended": "0.0.6",
"is-extended": "0.0.10",
"object-extended": "0.0.7",
"safer-buffer": "^2.1.2",
"string-extended": "0.0.8"
}
},
"fs-constants": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
},
"fstream": {
"version": "1.0.12",
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz",
"integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==",
"requires": {
"graceful-fs": "^4.1.2",
"inherits": "~2.0.0",
"mkdirp": ">=0.5 0",
"rimraf": "2"
}
},
"glob": {
"version": "7.1.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
},
"graceful-fs": {
"version": "4.2.4",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
"integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw=="
},
"ieee754": {
"version": "1.1.13",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz",
"integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg=="
},
"immediate": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
"integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps="
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"requires": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"is-extended": {
"version": "0.0.10",
"resolved": "https://registry.npmjs.org/is-extended/-/is-extended-0.0.10.tgz",
"integrity": "sha1-JE4UDfdbscmjEG9BL/GC+1NKbWI=",
"requires": {
"extended": "~0.0.3"
}
},
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"jszip": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/jszip/-/jszip-3.4.0.tgz",
"integrity": "sha512-gZAOYuPl4EhPTXT0GjhI3o+ZAz3su6EhLrKUoAivcKqyqC7laS5JEv4XWZND9BgcDcF83vI85yGbDmDR6UhrIg==",
"requires": {
"lie": "~3.3.0",
"pako": "~1.0.2",
"readable-stream": "~2.3.6",
"set-immediate-shim": "~1.0.1"
},
"dependencies": {
"readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
}
}
},
"lazystream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz",
"integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=",
"requires": {
"readable-stream": "^2.0.5"
},
"dependencies": {
"readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
}
}
},
"lie": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
"integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
"requires": {
"immediate": "~3.0.5"
}
},
"listenercount": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/listenercount/-/listenercount-1.0.1.tgz",
"integrity": "sha1-hMinKrWcRyUyFIDJdeZQg0LnCTc="
},
"lodash": {
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
},
"lodash.defaults": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz",
"integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw="
},
"lodash.difference": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz",
"integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw="
},
"lodash.flatten": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz",
"integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8="
},
"lodash.isplainobject": {
"version": "4.0.6",
"resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
"integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs="
},
"lodash.union": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz",
"integrity": "sha1-SLtQiECfFvGCFmZkHETdGqrjzYg="
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
},
"mkdirp": {
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
"integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
"requires": {
"minimist": "^1.2.5"
}
},
"moment": {
"version": "2.26.0",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.26.0.tgz",
"integrity": "sha512-oIixUO+OamkUkwjhAVE18rAMfRJNsNe/Stid/gwHSOfHrOtw9EhAY2AHvdKZ/k/MggcYELFCJz/Sn2pL8b8JMw=="
},
"normalize-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA=="
},
"object-extended": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/object-extended/-/object-extended-0.0.7.tgz",
"integrity": "sha1-hP0j9WsVWCrrPoiwXLVdJDLWijM=",
"requires": {
"array-extended": "~0.0.4",
"extended": "~0.0.3",
"is-extended": "~0.0.3"
}
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"requires": {
"wrappy": "1"
}
},
"pako": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
},
"process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
},
"promish": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/promish/-/promish-5.1.1.tgz",
"integrity": "sha512-37xEzvSas6JIYI/BcKh5TwhaqWepI44u/hC+tQStkX1sxMf+L756beESPgSWirxRCPqtXHzosoNzpjLnTnP8FA==",
"requires": {
"es6-promise": "^3.0.2"
}
},
"readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
},
"rimraf": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
"requires": {
"glob": "^7.1.3"
}
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"sax": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
},
"set-immediate-shim": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz",
"integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E="
},
"setimmediate": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="
},
"string-extended": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/string-extended/-/string-extended-0.0.8.tgz",
"integrity": "sha1-dBlX3/SHsCcqee7FpE8jnubxfM0=",
"requires": {
"array-extended": "~0.0.5",
"date-extended": "~0.0.3",
"extended": "~0.0.3",
"is-extended": "~0.0.3"
}
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "~5.1.0"
}
},
"tar-stream": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.2.tgz",
"integrity": "sha512-UaF6FoJ32WqALZGOIAApXx+OdxhekNMChu6axLJR85zMMjXKWFGjbIRe+J6P4UnRGg9rAwWvbTT0oI7hD/Un7Q==",
"requires": {
"bl": "^4.0.1",
"end-of-stream": "^1.4.1",
"fs-constants": "^1.0.0",
"inherits": "^2.0.3",
"readable-stream": "^3.1.1"
}
},
"tmp": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.1.0.tgz",
"integrity": "sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw==",
"requires": {
"rimraf": "^2.6.3"
}
},
"traverse": {
"version": "0.3.9",
"resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz",
"integrity": "sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk="
},
"typescript": {
"version": "3.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.3.tgz",
"integrity": "sha512-D/wqnB2xzNFIcoBG9FG8cXRDjiqSTbG2wd8DMZeQyJlP1vfTkIxH4GKveWaEBYySKIg+USu+E+EDIR47SqnaMQ==",
"dev": true
},
"unzipper": {
"version": "0.9.15",
"resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.9.15.tgz",
"integrity": "sha512-2aaUvO4RAeHDvOCuEtth7jrHFaCKTSXPqUkXwADaLBzGbgZGzUDccoEdJ5lW+3RmfpOZYNx0Rw6F6PUzM6caIA==",
"requires": {
"big-integer": "^1.6.17",
"binary": "~0.3.0",
"bluebird": "~3.4.1",
"buffer-indexof-polyfill": "~1.0.0",
"duplexer2": "~0.1.4",
"fstream": "^1.0.12",
"listenercount": "~1.0.1",
"readable-stream": "~2.3.6",
"setimmediate": "~1.0.4"
},
"dependencies": {
"readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
}
}
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
},
"zip-stream": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-2.1.3.tgz",
"integrity": "sha512-EkXc2JGcKhO5N5aZ7TmuNo45budRaFGHOmz24wtJR7znbNqDPmdZtUauKX6et8KAVseAMBOyWJqEpXcHTBsh7Q==",
"requires": {
"archiver-utils": "^2.1.0",
"compress-commons": "^2.1.1",
"readable-stream": "^3.4.0"
}
}
}
}

View File

@@ -10,11 +10,10 @@
"profiles": {
"Electron.NET App": {
"commandName": "Executable",
"executablePath": "electronize",
"executablePath": "$(SolutionDir)ElectronNET.CLI\\bin\\Debug\\netcoreapp3.1\\dotnet-electronize.exe",
"commandLineArgs": "start",
"workingDirectory": "."
"workingDirectory": "$(SolutionDir)ElectronNET.WebApp"
},
"IIS Express": {
"commandName": "IISExpress",
"environmentVariables": {

View File

@@ -4,7 +4,6 @@ using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Hosting;
namespace ElectronNET.WebApp

View File

@@ -3,6 +3,7 @@
"splashscreen": {
"imageFile": "/wwwroot/assets/img/about@2x.png"
},
"environment": "Production",
"singleInstance": false,
"build": {
"appId": "com.electronnetapidemos.app",

View File

@@ -54,13 +54,13 @@ PM> Install-Package ElectronNET.API
You start Electron.NET up with an `UseElectron` WebHostBuilder-Extension.
```csharp
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseElectron(args);
webBuilder.UseStartup<Startup>();
});
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseElectron(args);
webBuilder.UseStartup<Startup>();
});
```
### Startup.cs
@@ -167,6 +167,8 @@ Please make sure all commits are properly documented.
## 🧪 Working with this Repo
This video provides an introduction to development for Electron.NET: [Electron.NET - Contributing Getting Started](https://youtu.be/Po-saU_Z6Ws)
This repository consists of the main parts (API & CLI) and it's own "playground" ASP.NET Core application. Both main parts produce local NuGet packages, that are versioned with 99.0.0. The first thing you will need is to run one of the buildAll scripts (.cmd for Windows, the other for macOS/Linux).
If you look for pure __[demo projects](https://github.com/ElectronNET)__ checkout the other repositories.

View File

@@ -1,4 +1,4 @@
set ENETVER=8.31.1
set ENETVER=9.31.2
echo "Start building Electron.NET dev stack..."
echo "Restore & Build API"
cd ElectronNet.API