diff --git a/ElectronNET.API/BrowserWindow.cs b/ElectronNET.API/BrowserWindow.cs
index 546c0467..382c4445 100644
--- a/ElectronNET.API/BrowserWindow.cs
+++ b/ElectronNET.API/BrowserWindow.cs
@@ -1939,6 +1939,14 @@ public void SetMenu(MenuItem[] menuItems)
});
}
+ ///
+ /// Remove the window's menu bar.
+ ///
+ public void RemoveMenu()
+ {
+ BridgeConnector.Socket.Emit("browserWindowRemoveMenu", Id);
+ }
+
///
/// Sets progress value in progress bar. Valid range is [0, 1.0]. Remove progress
/// bar when progress smaler as 0; Change to indeterminate mode when progress bigger as 1. On Linux
diff --git a/ElectronNET.Host/api/browserWindows.js b/ElectronNET.Host/api/browserWindows.js
index be0a88c2..239f2352 100644
--- a/ElectronNET.Host/api/browserWindows.js
+++ b/ElectronNET.Host/api/browserWindows.js
@@ -440,6 +440,9 @@ module.exports = (socket, app) => {
}
getWindowById(id).setMenu(menu);
});
+ socket.on('browserWindowRemoveMenu', (id) => {
+ getWindowById(id).removeMenu();
+ });
function addMenuItemClickConnector(menuItems, callback) {
menuItems.forEach((item) => {
if (item.submenu && item.submenu.items.length > 0) {
diff --git a/ElectronNET.Host/api/browserWindows.ts b/ElectronNET.Host/api/browserWindows.ts
index b4aa0e11..ae473cb4 100644
--- a/ElectronNET.Host/api/browserWindows.ts
+++ b/ElectronNET.Host/api/browserWindows.ts
@@ -573,6 +573,10 @@ export = (socket: SocketIO.Socket, app: Electron.App) => {
getWindowById(id).setMenu(menu);
});
+ socket.on('browserWindowRemoveMenu', (id) => {
+ getWindowById(id).removeMenu();
+ });
+
function addMenuItemClickConnector(menuItems, callback) {
menuItems.forEach((item) => {
if (item.submenu && item.submenu.items.length > 0) {