Read/write find pasteboard text via IPC in renderer process
This commit is contained in:
parent
144a61c5a3
commit
1718697ef0
1 changed files with 10 additions and 1 deletions
|
@ -2,5 +2,14 @@ if (process.platform === 'linux' && process.type === 'renderer') {
|
||||||
// On Linux we could not access clipboard in renderer process.
|
// On Linux we could not access clipboard in renderer process.
|
||||||
module.exports = require('electron').remote.clipboard
|
module.exports = require('electron').remote.clipboard
|
||||||
} else {
|
} else {
|
||||||
module.exports = process.atomBinding('clipboard')
|
const clipboard = process.atomBinding('clipboard')
|
||||||
|
|
||||||
|
// Read/write to find pasteboard over IPC since only main process is notified
|
||||||
|
// of changes
|
||||||
|
if (process.platform === 'darwin' && process.type === 'renderer') {
|
||||||
|
clipboard.readFindText = require('electron').remote.clipboard.readFindText
|
||||||
|
clipboard.writeFindText = require('electron').remote.clipboard.writeFindText
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = clipboard
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue