Skip to content

Instantly share code, notes, and snippets.

@vivek081166
Last active March 29, 2019 02:08
Show Gist options
  • Save vivek081166/29a5ae2e43d6fd65f6050926668254ca to your computer and use it in GitHub Desktop.
Save vivek081166/29a5ae2e43d6fd65f6050926668254ca to your computer and use it in GitHub Desktop.
import {app, BrowserWindow} from 'electron';
import * as path from 'path';
import * as url from 'url';
let win: BrowserWindow;
app.on('ready', createWindow);
app.on('activate', () => {
if (win === null) {
createWindow();
}
});
function createWindow() {
win = new BrowserWindow({width: 800, height: 600});
win.loadURL(
url.format({
pathname: path.join(__dirname, `/../../dist/teachable-desktop-automation/index.html`),
protocol: 'file:',
slashes: true,
}),
);
win.webContents.openDevTools();
win.on('closed', () => {
win = null;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment