Skip to content

Commit

Permalink
现在使用截图快捷键截图的同时,会自动复制截图到您的剪贴板了
Browse files Browse the repository at this point in the history
  • Loading branch information
iamapig120 committed Jan 22, 2019
1 parent 5726600 commit 8597fed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions bin/main/mainLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
const fs = require('fs')
const path = require('path')
const electron = require('electron')
const { ipcRenderer } = electron
const { ipcRenderer, remote } = electron
const userConfigs = require('../../configs-user.json')

const clipboard = remote.clipboard

/**
* @type {Electron.WebviewTag}
*/
Expand Down Expand Up @@ -82,7 +84,9 @@ ipcRenderer.on('take-screenshot', () => {
if (webContents) {
webContents.capturePage(image => {
ipcRenderer.send('application-message', 'take-screenshot', image.toPNG())
showScreenshotLabel(image.toDataURL())
const dataURL = image.toDataURL()
showScreenshotLabel(dataURL)
clipboard.writeImage(image)
})
}
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "majsoul-plus-client",
"version": "1.8.1",
"version": "1.8.2",
"productName": "Majsoul Plus",
"author": "MajsoulPlus Team",
"description": "Majsoul Plus",
Expand Down

0 comments on commit 8597fed

Please sign in to comment.