Upgrade electron
This commit is contained in:
@@ -44,7 +44,10 @@ function createWindow() {
|
||||
var win = new BrowserWindow({
|
||||
show: false,
|
||||
width: 8000,
|
||||
height: 8000
|
||||
height: 8000,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
});
|
||||
|
||||
// Load index.html
|
||||
|
||||
@@ -116,14 +116,18 @@ function capture(frameIndex, callback) {
|
||||
|
||||
stepsCounter = (stepsCounter + 1) % step;
|
||||
|
||||
capturePage(captureRect, function(img) {
|
||||
|
||||
capturePage(captureRect).then((img) => {
|
||||
|
||||
var outputPath = path.join(renderDir, frameIndex + '.png');
|
||||
|
||||
|
||||
fs.writeFileSync(outputPath, img.toPNG());
|
||||
ipcRenderer.send('captured', frameIndex);
|
||||
callback();
|
||||
|
||||
|
||||
}).catch((err) => {
|
||||
|
||||
throw new err;
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user