Socket
Socket
Sign inDemoInstall

electron-vue-screen-capture

Package Overview
Dependencies
14
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    electron-vue-screen-capture

[![NPM version](https://img.shields.io/npm/v/electron-vue-screen-capture.svg?sanitize=true)](https://www.npmjs.com/package/electron-vue-screen-capture) [![Downloads](https://img.shields.io/npm/dm/electron-vue-screen-capture.svg)](http://badge.fury.io/js/


Version published
Weekly downloads
35
increased by1650%
Maintainers
1
Install size
12.0 MB
Created
Weekly downloads
 

Readme

Source

electron-vue-screen-capture

NPM version Downloads

screen capture base on electron & vue

usage

// install
npm install electron-vue-screen-capture -S

// config in vue.config.js
pluginOptions: {
  electronBuilder: {
    builderOptions: {
      extraResources:[{
        from: 'node_modules/electron-vue-screen-capture/dist_electron/bundled/',
        to: './screen-capture'
      }]
    }
  }
}

// use
import { init, start, close, targetWin } from 'electron-vue-screen-capture/src/main/modules/screenCapture.js'
// initial render process
init(win) // your BrowserWindow

// after clicked a btn,show capture window
start(type) // type 'minimum' will hide the targetWin

// after capture finished/cancaled
ipcMain.on('getCaptureData', (e, data) => {
  // base64 for image, if capture was canceled, return false
  if (typeof data === 'string') targetWin.send('getCaptureData', data);
  // after finish deal with image, close capture's window manualy
  close('hide');
});

ipcRenderer.on('screenCaptureAuthFailed', () => {
  // mac ScreenCapture promission failed
  // do something in your BrowserWindow
})

// close capture manualy
close(type)
// type 'refresh' will exit capture's windows and restart
// type 'hide' will hide capture's windows
// otherwise force destory capture's windows

downloads

single version

develop

npm i
npm run serve

mainly achieved features

  1. tested and could be used in electron 8.x ~ 9.X (chromium 80 ~ 83)
  2. support mac & windows platform
  3. get mac's screenCapture promission automatically (after macOS 10.15)
  4. support only fullscreen's capture, window's capture was not supported

optimize

FAQs

Last updated on 09 Mar 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc