I'm building an app using electron 1.0 and unfortunately everywhere I look for guides and tutorials with it, no one uses electron 1 because it's so new.
I am trying to close a frameless window through the click of a button I made. I know the button works because I have check to make sure it can do simple things (i.e. change some text or whatever) but that's only when I use internal javascript but I am trying to use external javascript. When I use external the function never gets called...
const {remote} = require('electron'); const {BrowserWindow} = require('electron').remote; document.getElementById("close-button").addEventListener("click", function (e) { var window = remote.getCurrentWindow(); window.close(); });
That is my javascript file. I also know I am linking the file properly because I can use document.write() and it works.
What am I doing wrong here?
any help is greatly appreciated thanks!
Edit: Added remote line.
Although there is another reason why my event handler isn't working for my button. This question is closed and the answer has been accepted.