Skip to content

An extension for Electron's BrowserWindow, Make it can capture full page.

Notifications You must be signed in to change notification settings

GeoffZhu/electron-capture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

electron-capture

An extension for Electron's BrowserWindow, Make it have the ability to capture full page.

npm version

Why I create this repo

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.

Install

npm install electron-capture --save

Usage

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'));
})

Demo

Releases

No releases published

Packages

No packages published