
Research
/Security News
11 Malicious NuGet Tools Pose as Game Cheats to Drop a Windows Host-Surveillance Payload
11 malicious NuGet tools pose as game cheats to deploy Windows payloads, track hosts, and use Google Sheets for telemetry and control.
mind-electron-screenshots
Advanced tools
基于react-screenshots的0.0.14版本修改
import debug from 'electron-debug'
import { app, globalShortcut } from 'electron'
import Screenshots from './screenshots'
app.on('ready', () => {
const screenshots = new Screenshots()
globalShortcut.register('ctrl+shift+a', () => screenshots.startCapture())
// 点击确定按钮回调事件
screenshots.on('ok', (e, { viewer }) => {
console.log('capture', viewer)
})
// 点击取消按钮回调事件
screenshots.on('cancel', () => {
console.log('capture', 'cancel1')
})
screenshots.on('cancel', e => {
// 执行了preventDefault
// 点击取消不会关闭截图窗口
e.preventDefault()
console.log('capture', 'cancel2')
})
// 点击保存按钮回调事件
screenshots.on('save', (e, { viewer }) => {
console.log('capture', viewer)
})
debug({ showDevTools: true, devToolsMode: 'undocked' })
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
{
externals: {
'electron-screenshots': 'require("electron-screenshots")'
}
}
vue-cli-plugin-electron-builder配置示例vue-cli-plugin-electron-builder-issue// vue.config.js
module.exports = {
publicPath: '.',
pluginOptions: {
electronBuilder: {
// 不打包,使用 require 加载
externals: ['shortcut-capture']
}
}
}
| 名称 | 说明 | 参数 | 返回值 |
|---|---|---|---|
| startCapture | 调用截图方法截图 | - | - |
| endCapture | 手动结束截图 | - | - |
interface Bounds {
x1: number
y1: number
x2: number
y2: number
}
interface CaptureData {
dataURL: string // 图片资源base64
bounds: Bounds // 截图区域坐标信息
}
type OkData = CaptureData
type SaveData = CaptureData
| 名称 | 说明 | 回调参数 |
|---|---|---|
| ok | 截图确认事件 | event:事件对象, data:OkData: 截图信息 |
| cancel | 截图取消事件 | event:事件对象 |
| save | 截图保存事件 | event:事件对象,data:OkData: 截图信息 |
event对象可调用preventDefault方法来阻止默认事件,例如阻止默认保存事件
const screenshots = new Screenshots()
screenshots.on('save', (e, data) => {
// 阻止插件自带的保存功能
// 用户自己控制保存功能
e.preventDefault()
// 用户可在这里自己定义保存功能
console.log('capture', data)
})
screenshots.startCapture()

FAQs
electron 截图插件
The npm package mind-electron-screenshots receives a total of 2 weekly downloads. As such, mind-electron-screenshots popularity was classified as not popular.
We found that mind-electron-screenshots demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Research
/Security News
11 malicious NuGet tools pose as game cheats to deploy Windows payloads, track hosts, and use Google Sheets for telemetry and control.

Research
/Security News
4 compromised asyncapi packages deliver miasma botnet loader on macOS, Linux and Windows.

Research
/Security News
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.