Skip to content

Instantly share code, notes, and snippets.

@vivek081166 vivek081166/main.ts
Last active Mar 29, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.