diff --git a/js/notifications.js b/js/notifications.js index 0f79a15..e99ecc5 100644 --- a/js/notifications.js +++ b/js/notifications.js @@ -24,7 +24,8 @@ weechat.factory('notifications', ['$rootScope', '$log', 'models', 'settings', fu } } - if ('serviceWorker' in navigator) { + // 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")) { $log.info('Service Worker is supported'); navigator.serviceWorker.register('serviceworker.js').then(function(reg) { $log.info('Service Worker install:', reg);