diff options
Diffstat (limited to 'recipes/whatsapp')
-rw-r--r-- | recipes/whatsapp/index.js | 6 | ||||
-rw-r--r-- | recipes/whatsapp/package.json | 2 | ||||
-rw-r--r-- | recipes/whatsapp/webview.js | 22 |
3 files changed, 15 insertions, 15 deletions
diff --git a/recipes/whatsapp/index.js b/recipes/whatsapp/index.js index 96c95a3..4caf116 100644 --- a/recipes/whatsapp/index.js +++ b/recipes/whatsapp/index.js | |||
@@ -1,13 +1,13 @@ | |||
1 | module.exports = (Franz) => class Messenger extends Franz { | 1 | module.exports = (Ferdi) => class Messenger extends Ferdi { |
2 | overrideUserAgent() { | 2 | overrideUserAgent() { |
3 | return window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+( \([^)]+\))?/g, '').trim(); | 3 | return window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+ \([^)]+\)/g, '').trim(); |
4 | } | 4 | } |
5 | 5 | ||
6 | modifyRequestHeaders() { | 6 | modifyRequestHeaders() { |
7 | return [ | 7 | return [ |
8 | { | 8 | { |
9 | headers: { | 9 | headers: { |
10 | 'user-agent': window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+( \([^)]+\))?/g, '').trim(), | 10 | 'user-agent': window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+ \([^)]+\)/g, '').trim(), |
11 | }, | 11 | }, |
12 | requestFilters: { | 12 | requestFilters: { |
13 | urls: ['*://*/*'], | 13 | urls: ['*://*/*'], |
diff --git a/recipes/whatsapp/package.json b/recipes/whatsapp/package.json index 58f440e..360cc47 100644 --- a/recipes/whatsapp/package.json +++ b/recipes/whatsapp/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "whatsapp", | 2 | "id": "whatsapp", |
3 | "name": "WhatsApp", | 3 | "name": "WhatsApp", |
4 | "version": "3.1.2", | 4 | "version": "3.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://web.whatsapp.com", | 7 | "serviceURL": "https://web.whatsapp.com", |
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 @@ | |||
1 | const { | 1 | const { remote } = require('electron'); |
2 | remote, | ||
3 | } = require('electron'); | ||
4 | 2 | ||
5 | const path = require('path'); | 3 | const _path = _interopRequireDefault(require('path')); |
4 | |||
5 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
6 | 6 | ||
7 | const webContents = remote.getCurrentWebContents(); | 7 | const webContents = remote.getCurrentWebContents(); |
8 | const { | 8 | const { session } = webContents; |
9 | session, | 9 | |
10 | } = webContents; | ||
11 | window.addEventListener('beforeunload', async () => { | 10 | window.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 | ||
27 | module.exports = Franz => { | 26 | module.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 | }; |