glowingbear-mainbox/electron-globals.js

20 lines
456 B
JavaScript
Raw Normal View History

/**
* Global functions for electron app
*/
var ipc = require('electron').ipcRenderer;
// Set app bagde
var setElectronBadge = function(value) {
2016-04-03 13:25:54 +02:00
// Check ipc
if (ipc && typeof ipc.send === 'function') {
2016-04-03 13:25:54 +02:00
// Send new badge value
ipc.send('badge', value);
}
};
// Export global variables and functions
global.setElectronBadge = setElectronBadge;
2016-04-02 18:07:12 +02:00
// Let Glowing Bear know it's running as an electron app
window.is_electron = 1;