From cf255756aefc6dbe4afba215d9510dabd69c93ac Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Sun, 3 Apr 2016 13:52:35 +0200 Subject: [PATCH] use new global to check for electron --- js/notifications.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/notifications.js b/js/notifications.js index 9ef5fc1..f5e561b 100644 --- a/js/notifications.js +++ b/js/notifications.js @@ -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 - 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'); navigator.serviceWorker.register('serviceworker.js').then(function(reg) { $log.info('Service Worker install:', reg);