Electron getFocusedWindow().close() not working
I'm having a lil trouble with electron, when making a custom title bar, my trouble is e.g. when i use
JS:
document.getElementById("close-btn").addEventListener("click", function (e) {
const { remote } = require('electron');
remote.BrowserWindow.getFocusedWindow().close();
});
HTML:
<div id="title-bar">
<div id="title">My App</div>
<div id="title-bar-btns">
<button id="min-btn">-</button>
<button id="max-btn">[]</button>
<button id="close-btn">x</button>
</div>
</div>
which is supposed to close the current window, but it doesnt do anything, i click the button, and what happens? Nothing.
from Recent Questions - Stack Overflow https://ift.tt/3lYazDK
https://ift.tt/eA8V8J
Comments
Post a Comment