From b54e786b0907ab5120134bfef6cce3628167c325 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 26 Mar 2015 15:46:08 +0800 Subject: [PATCH] linux: it is now safe to use clipboard in renderer process --- atom/common/api/lib/clipboard.coffee | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/atom/common/api/lib/clipboard.coffee b/atom/common/api/lib/clipboard.coffee index 174856181a..582feba4b1 100644 --- a/atom/common/api/lib/clipboard.coffee +++ b/atom/common/api/lib/clipboard.coffee @@ -1,14 +1,9 @@ -if process.platform is 'linux' and process.type is 'renderer' - # On Linux we could not access clipboard in renderer process. - module.exports = require('remote').require '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 - readImage: (type='standard') -> binding._readImage type - writeImage: (image, type='standard') -> binding._writeImage image, type - clear: (type='standard') -> binding._clear type +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 + readImage: (type='standard') -> binding._readImage type + writeImage: (image, type='standard') -> binding._writeImage image, type + clear: (type='standard') -> binding._clear type