for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
"use strict";
const {
BrowserWindow,
TouchBar
} = require('electron');
const path = require('path');
const url = require('url');
const touchbar = require('./touchbar');
const open = require("open");
let mainWindow;
let createWindow = () => {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600
});
mainWindow.maximize();
// mainWindow.webContents.loadURL('http://example.com');
// and load the index.html of the app.
mainWindow.loadURL(url.format({
pathname: path.join(__dirname, '../views/index.html'),
protocol: 'file:',
slashes: true
}));
mainWindow.webContents.on('new-window', (event, url) => {
event.preventDefault();
open(url);
// Open the DevTools.
mainWindow.webContents.openDevTools();
touchbar.setMainWindow(mainWindow);
mainWindow.setTouchBar(touchbar.touchBar);
//
// Emitted when the window is closed.
mainWindow.on('closed', () => {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null;
};
module.exports = {
createWindow: createWindow