
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
electron 截图插件
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 test_kai receives a total of 2 weekly downloads. As such, test_kai popularity was classified as not popular.
We found that test_kai 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.