diff --git a/app/preload.js b/app/preload.js index 5d331be..df49cd7 100644 --- a/app/preload.js +++ b/app/preload.js @@ -12,6 +12,7 @@ var _ = require('underscore'); var ipc = require('electron').ipcRenderer; var remote = require('electron').remote; var shell = require('electron').shell; +var desktopCapturer = require('electron').desktopCapturer; /** * Defines methods with which to extend the `Electron` module defined in `client.js`. @@ -81,5 +82,10 @@ ElectronImplementation = { listeners.push(callback); }, - _eventListeners: {} + _eventListeners: {}, + + /** + * Expose Electrons desktopCapturer API used to enable screen capture. + */ + desktopCapturer: desktopCapturer, }; diff --git a/client/index.js b/client/index.js index ca76f3f..fd36bbc 100644 --- a/client/index.js +++ b/client/index.js @@ -52,7 +52,12 @@ Electron = { * @param {Function} callback - A function to invoke when `event` is triggered. Takes no arguments * and returns no value. */ - onWindowEvent: function() {} + onWindowEvent: function() {}, + + /** + * Expose Electrons desktopCapturer API used to enable screen capture. + */ + desktopCapturer: {} }; // Read `ElectronImplementation` from the window vs. doing `typeof ElectronImplementation` because