aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/whatsapp/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/whatsapp/webview.js')
-rw-r--r--recipes/whatsapp/webview.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/recipes/whatsapp/webview.js b/recipes/whatsapp/webview.js
index 143c066..773caa8 100644
--- a/recipes/whatsapp/webview.js
+++ b/recipes/whatsapp/webview.js
@@ -1,13 +1,12 @@
1const { 1const { remote } = require('electron');
2 remote,
3} = require('electron');
4 2
5const path = require('path'); 3const _path = _interopRequireDefault(require('path'));
4
5function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6 6
7const webContents = remote.getCurrentWebContents(); 7const webContents = remote.getCurrentWebContents();
8const { 8const { session } = webContents;
9 session, 9
10} = webContents;
11window.addEventListener('beforeunload', async () => { 10window.addEventListener('beforeunload', async () => {
12 try { 11 try {
13 session.flushStorageData(); 12 session.flushStorageData();
@@ -24,7 +23,7 @@ window.addEventListener('beforeunload', async () => {
24 } 23 }
25}); 24});
26 25
27module.exports = Franz => { 26module.exports = Ferdi => {
28 const getMessages = function getMessages() { 27 const getMessages = function getMessages() {
29 let count = 0; 28 let count = 0;
30 let indirectCount = 0; 29 let indirectCount = 0;
@@ -46,9 +45,10 @@ module.exports = Franz => {
46 } 45 }
47 } 46 }
48 47
49 Franz.setBadge(count, indirectCount); 48 Ferdi.setBadge(count, indirectCount);
50 }; 49 };
51 50
52 Franz.injectCSS(path.join(__dirname, 'service.css')); 51 Ferdi.loop(getMessages);
53 Franz.loop(getMessages); 52
53 Ferdi.injectCSS(_path.default.join(__dirname, 'service.css'));
54}; 54};