forked from gurayyarar/NodeJsPackageManager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
34 lines (26 loc) · 899 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const electron = require('electron');
const { app, BrowserWindow } = electron;
app.on('ready', onReady);
function onReady() {
let win = new BrowserWindow({
icon: `${__dirname}/images/app.ico`,
});
win.maximize();
win.webContents.on('new-window', (event, url) => {
event.preventDefault();
const { width, height } = electron.screen.getPrimaryDisplay().workAreaSize;
const modalWin = new BrowserWindow({
icon: `${__dirname}/images/app.ico`,
width: width * .9,
height: height * .9,
parent: win,
modal: true,
title: "The website is loading..."
});
modalWin.setMenu(null);
modalWin.once('ready-to-show', () => modalWin.show());
modalWin.loadURL(url);
event.newGuest = modalWin;
})
win.loadURL(`file://${__dirname}/index.html`);
}