title: Cannot get property of undefined browser window
body: <p>When running electron 13.1.X and above I get the error - menuHandler.js:8 Uncaught TypeError: Cannot read properties of undefined (reading 'getBrowserWindow').</p>
  <p>code from main.js</p>
  <pre><code>const { electron, app, Notification, ipcMain } = require('electron');
  var Path = require('path');
  var url = require('url');
  const { BrowserWindow } = require('electron');
  </code></pre>
  <p>The error occurs from menuHandler.js:8</p>
  <pre><code>const { remote } = require(&quot;electron&quot;);
  const Window = remote.getBrowserWindow();
  </code></pre>
  <p>And so, I can't use the function:</p>
  <pre><code>$(&quot;#minimize&quot;).click(function() {
  Window.minimize();
  </code></pre>
  <p>});</p>
  <p>Here it throws an error passing the above message, meanwhile it works fine on older versions of electron. Please how can I fix this?</p>