Answers for "electron new window"

1

electron open new window

const button = document.getElementById('<your_button_id>');
button.addEventListener('click', () => {
  createBrowserWindow();
});

function createBrowserWindow() {
  const remote = require('electron').remote;
  const BrowserWindow = remote.BrowserWindow;
  const win = new BrowserWindow({
    height: 600,
    width: 800
  });

  win.loadURL('<url>');
}
Posted by: Guest on March-30-2020
1

electron new window

const electron = require('electron')
const BrowserWindow = electron.remote.BrowserWindow

$( "#target" ).click(function() {
	let win = new BrowserWindow({ show: false })
	win.on('close', function () { win = null })
	win.loadURL("github.com")
	win.once('ready-to-show', () => {
  		win.show()
	})
});
Posted by: Guest on April-15-2020
0

create window electron

const createWindow = () => {
  const mainWindow = new BrowserWindow({
    width: 800,
    height: 400,
  });
  mainWindow.loadFile(path.join(__dirname, 'index.html'));
};
Posted by: Guest on January-09-2021
0

create window electron

app.on('ready', createWindow);
Posted by: Guest on January-09-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language