Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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>');
}
Comment

create window electron

const createWindow = () => {
  const mainWindow = new BrowserWindow({
    width: 800,
    height: 400,
  });
  mainWindow.loadFile(path.join(__dirname, 'index.html'));
};
Comment

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()
	})
});
Comment

create window electron

app.on('ready', createWindow);
Comment

PREVIOUS NEXT
Code Example
Javascript :: js array from 
Javascript :: jquery has parent with class 
Javascript :: react webpack.config.js example 
Javascript :: how to see node taints 
Javascript :: js iso date split 
Javascript :: how to remove child element in jquery 
Javascript :: Difference in push and navigate in react Navigation 
Javascript :: node js currency format 
Javascript :: base64 to image nodejs 
Javascript :: canvas rectangle rounded corners 
Javascript :: require statement not part of import statement 
Javascript :: types of loops in javascript 
Javascript :: fetch get request 
Javascript :: delay in javascript without await 
Javascript :: remove duplicate value from array 
Javascript :: jquery on scroll 
Javascript :: vuetify autocomplete get input value 
Javascript :: nodejs call api 
Javascript :: how to run react builed version 
Javascript :: discord.js lockdown command 
Javascript :: generate random color array javascript 
Javascript :: javascript increment by 1 
Javascript :: how to set visibility in javascript of html title 
Javascript :: node js ffmpeg image to video 
Javascript :: npm fs 
Javascript :: onload of modal jquery function 
Javascript :: ace editor set theme 
Javascript :: how to change favicon dynamic in react js 
Javascript :: array.from javascript 
Javascript :: use jq to update json file 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =