Update electron demo to version 9.0.2

This commit is contained in:
Ian Jennings 2020-06-04 16:31:01 -05:00
parent baea1798cf
commit 4a10131ed3
2 changed files with 17 additions and 8 deletions

@ -7,14 +7,20 @@ var app = electron.app;
var win = null;
function createWindow() {
if(win) return;
win = new electron.BrowserWindow({width:800, height:600});
if (win) return;
win = new electron.BrowserWindow({
width: 800, height: 600,
//The lines below solved the issue
webPreferences: {
nodeIntegration: true
}
});
win.loadURL("file://" + __dirname + "/index.html");
win.webContents.openDevTools();
win.on('closed', function() { win = null; });
win.on('closed', function () { win = null; });
}
if(app.setAboutPanelOptions) app.setAboutPanelOptions({ applicationName: 'sheetjs-electron', applicationVersion: "XLSX " + XLSX.version, copyright: "(C) 2017-present SheetJS LLC" });
app.on('open-file', function() { console.log(arguments); });
if (app.setAboutPanelOptions) app.setAboutPanelOptions({ applicationName: 'sheetjs-electron', applicationVersion: "XLSX " + XLSX.version, copyright: "(C) 2017-present SheetJS LLC" });
app.on('open-file', function () { console.log(arguments); });
app.on('ready', createWindow);
app.on('activate', createWindow);
app.on('window-all-closed', function() { if(process.platform !== 'darwin') app.quit(); });
app.on('window-all-closed', function () { if (process.platform !== 'darwin') app.quit(); });

@ -4,7 +4,10 @@
"version": "0.0.0",
"main": "main.js",
"dependencies": {
"electron": "~1.7.x",
"xlsx": "*"
"xlsx": "*",
"electron": "^9.0.2"
},
"scripts": {
"start": "electron ."
}
}