Provide API to access selection clipboard, fixes #377.

This commit is contained in:
Cheng Zhao 2014-06-05 14:48:12 +08:00
parent 7c14c2758b
commit 950704c7e8
3 changed files with 73 additions and 30 deletions

View file

@ -1,6 +1,12 @@
module.exports =
if process.platform is 'linux' and process.type is 'renderer'
# On Linux we could not access clipboard in renderer process.
require('remote').process.atomBinding 'clipboard'
else
process.atomBinding 'clipboard'
if process.platform is 'linux' and process.type is 'renderer'
# On Linux we could not access clipboard in renderer process.
module.exports = require('remote').process.atomBinding 'clipboard'
else
binding = process.atomBinding 'clipboard'
module.exports =
has: (format, type='standard') -> binding._has format, type
read: (format, type='standard') -> binding._read format, type
readText: (type='standard') -> binding._readText type
writeText: (text, type='standard') -> binding._writeText text, type
clear: (type='standard') -> binding._clear type