Advertisement
Pr0m3th3us

Untitled

Apr 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const electron = require('electron');
  2. const url = require('url'); //nodejs core module
  3. const path = require('path');
  4.  
  5. const {app, BrowserWindow} = electron;
  6.  
  7. let mainWindow;
  8.  
  9. //Listen for app to be ready
  10. app.on('ready', function(){
  11.     //Create new window
  12.     mainWindow = new BrowserWindow({});
  13.     //Load html into window
  14.     mainWindow.loadURL(url.format({    
  15.         pathname: path.join(__dirname, 'mainWindow.html'),
  16.         protocol:'file:',
  17.         slashes:true
  18.     }));
  19. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement