Provide API to access selection clipboard, fixes #377.
This commit is contained in:
parent
7c14c2758b
commit
950704c7e8
3 changed files with 73 additions and 30 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue