use new global to check for electron

This commit is contained in:
Tor Hveem 2016-04-03 13:52:35 +02:00
parent 382a5dc5c0
commit cf255756ae
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ weechat.factory('notifications', ['$rootScope', '$log', 'models', 'settings', fu
} }
// Check for serviceWorker support, and also disable serviceWorker if we're running in electron process, since that's just problematic and not necessary, since gb then already is in a separate process // Check for serviceWorker support, and also disable serviceWorker if we're running in electron process, since that's just problematic and not necessary, since gb then already is in a separate process
if ('serviceWorker' in navigator && (typeof window !== 'undefined' && window.process && window.process.type === "renderer")) { if ('serviceWorker' in navigator && window.is_electron !== 1) {
$log.info('Service Worker is supported'); $log.info('Service Worker is supported');
navigator.serviceWorker.register('serviceworker.js').then(function(reg) { navigator.serviceWorker.register('serviceworker.js').then(function(reg) {
$log.info('Service Worker install:', reg); $log.info('Service Worker install:', reg);