title: ipcRenderer.on() gets never called
body: <p><strong>app.js</strong></p>
  <pre><code>app.whenReady().then(() =&gt; {
       const win = new BrowserWindow({
           width: 800,
           height: 600
       )}
       win.loadFile('index.html')
       
       win.on(&quot;resized&quot;, () =&gt; {
           console.log(&quot;Window resized&quot;)
           win.webContents.send(&quot;resize&quot;, &quot;window resized&quot;)
       })
  }
  </code></pre>
  <p><strong>script.js</strong></p>
  <pre><code>require('electron').ipcRenderer.on('resize', (event, message) =&gt; {
      alert(&quot;Received!&quot;)
  })
  </code></pre>
  <p>of course I have included it in index.html <code>&lt;script type=&quot;text/javascript&quot; src=&quot;script.js&quot;&gt;&lt;/script&gt;</code></p>
  <p>Everything looks fine to me but when I run the application and resize the window I see in the console &quot;Window resized&quot; but the message is never received by ipcRenderer.on() function, what am I missing?</p>
  <p>I'm running on MacBook m1.</p>