2018-09-23 00:28:50 +12:00
|
|
|
'use strict'
|
|
|
|
|
2016-01-11 18:40:23 -08:00
|
|
|
if (process.platform === 'linux' && process.type === 'renderer') {
|
2016-01-14 10:35:29 -08:00
|
|
|
// On Linux we could not access clipboard in renderer process.
|
2016-03-25 12:41:24 -07:00
|
|
|
module.exports = require('electron').remote.clipboard
|
2016-01-11 18:40:23 -08:00
|
|
|
} else {
|
2016-10-25 13:43:24 +09:00
|
|
|
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
|
2016-01-11 18:40:23 -08:00
|
|
|
}
|