Created
May 7, 2018 12:18
-
-
Save andrewward2001/1b8e2a3aeb28a1ee398d9017cf735dfd to your computer and use it in GitHub Desktop.
sample electron entry point
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const {app} = require('electron'); | |
| const {BrowserWindow} = require('electron'); | |
| const path = require("path"); | |
| let mainWindow; | |
| app.on("ready", function () { | |
| mainWindow = new BrowserWindow({width: 500, height: 500, x: 50, y: 50}); | |
| mainWindow.loadURL('file://' + path.join(__dirname,'src/index.html')); | |
| mainWindow.setMenu(null); | |
| mainWindow.webContents.openDevTools() | |
| mainWindow.webContents.on('new-window', function(e, url) { | |
| e.preventDefault(); | |
| app.shell.openExternal(url); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment