Update electron demo #2027
@ -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 ."
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user