An extension for Electron's BrowserWindow, Make it have the ability to capture full page.
I tried a lots of npm packages, but no one can add the feature (full page capture) for my electron-application. So I code this.
npm install electron-capture --save
require('electron-capture')
mainWindow = new BrowserWindow({
width: 1366,
height: 768,
resizable: true,
webPreferences: {
preload: __dirname + '/node_modules/electron-capture/src/preload.js'
}
})
mainWindow.loadURL('https://www.google.com/')
mainWindow.captureFullPage(function(imageStream){
// return an image Stream
imageStream.pipe(fs.createWriteStream('example.png'));
})