From fe0e088eafdce8fb427f578edcc80d727b1a0412 Mon Sep 17 00:00:00 2001 From: Quang Lam Date: Thu, 29 Aug 2024 11:41:45 -0400 Subject: [PATCH] Fix the `window` option (#185) --- index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/index.js b/index.js index 3393445..b10daea 100644 --- a/index.js +++ b/index.js @@ -377,9 +377,7 @@ export default function contextMenu(options = {}) { disposeMenu(); }; - if (win.once !== undefined) { // Support for BrowserView - win.webContents.once('destroyed', disposable); - } + webContents(win).once('destroyed', disposable); }; const dispose = () => {