diff options
Diffstat (limited to 'recipes/messenger')
-rw-r--r-- | recipes/messenger/index.js | 4 | ||||
-rw-r--r-- | recipes/messenger/package.json | 2 | ||||
-rw-r--r-- | recipes/messenger/webview.js | 14 |
3 files changed, 10 insertions, 10 deletions
diff --git a/recipes/messenger/index.js b/recipes/messenger/index.js index 7ea3060..425683a 100644 --- a/recipes/messenger/index.js +++ b/recipes/messenger/index.js | |||
@@ -1,5 +1,5 @@ | |||
1 | module.exports = (Ferdi) => class Messenger extends Ferdi { | 1 | module.exports = (Ferdium) => class Messenger extends Ferdium { |
2 | overrideUserAgent() { | 2 | overrideUserAgent() { |
3 | return window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+ \([^)]+\)/g, '').trim(); | 3 | return window.navigator.userAgent.replace(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '').trim(); |
4 | } | 4 | } |
5 | }; | 5 | }; |
diff --git a/recipes/messenger/package.json b/recipes/messenger/package.json index d3a50a0..09c7793 100644 --- a/recipes/messenger/package.json +++ b/recipes/messenger/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "messenger", | 2 | "id": "messenger", |
3 | "name": "Messenger", | 3 | "name": "Messenger", |
4 | "version": "1.4.0", | 4 | "version": "1.5.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://messenger.com", | 7 | "serviceURL": "https://messenger.com", |
diff --git a/recipes/messenger/webview.js b/recipes/messenger/webview.js index 45b4460..c90f4ad 100644 --- a/recipes/messenger/webview.js +++ b/recipes/messenger/webview.js | |||
@@ -1,4 +1,4 @@ | |||
1 | module.exports = Ferdi => { | 1 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 2 | const getMessages = () => { |
3 | let count = 0; | 3 | let count = 0; |
4 | 4 | ||
@@ -9,7 +9,7 @@ module.exports = Ferdi => { | |||
9 | * see https://github.com/ferdium/ferdium-app/issues/1113#issuecomment-783409154 | 9 | * see https://github.com/ferdium/ferdium-app/issues/1113#issuecomment-783409154 |
10 | */ | 10 | */ |
11 | if (isNotification) { | 11 | if (isNotification) { |
12 | count = Ferdi.safeParseInt(/^\((\d+)\)/.exec(document.title)[1]); | 12 | count = Ferdium.safeParseInt(/^\((\d+)\)/.exec(document.title)[1]); |
13 | } else { | 13 | } else { |
14 | /* | 14 | /* |
15 | * Notification case for direct messages, workaround by manavortex | 15 | * Notification case for direct messages, workaround by manavortex |
@@ -33,13 +33,13 @@ module.exports = Ferdi => { | |||
33 | */ | 33 | */ |
34 | const messageRequestsElement = document.querySelector('._5nxf'); | 34 | const messageRequestsElement = document.querySelector('._5nxf'); |
35 | if (messageRequestsElement) { | 35 | if (messageRequestsElement) { |
36 | count += Ferdi.safeParseInt(messageRequestsElement.textContent); | 36 | count += Ferdium.safeParseInt(messageRequestsElement.textContent); |
37 | } | 37 | } |
38 | 38 | ||
39 | Ferdi.setBadge(count); | 39 | Ferdium.setBadge(count); |
40 | }; | 40 | }; |
41 | 41 | ||
42 | Ferdi.loop(getMessages); | 42 | Ferdium.loop(getMessages); |
43 | 43 | ||
44 | localStorage.setItem( | 44 | localStorage.setItem( |
45 | '_cs_desktopNotifsEnabled', | 45 | '_cs_desktopNotifsEnabled', |
@@ -49,8 +49,8 @@ module.exports = Ferdi => { | |||
49 | }), | 49 | }), |
50 | ); | 50 | ); |
51 | 51 | ||
52 | if (typeof Ferdi.onNotify === 'function') { | 52 | if (typeof Ferdium.onNotify === 'function') { |
53 | Ferdi.onNotify(notification => { | 53 | Ferdium.onNotify(notification => { |
54 | if (typeof notification.title !== 'string') { | 54 | if (typeof notification.title !== 'string') { |
55 | notification.title = | 55 | notification.title = |
56 | ((notification.title.props || {}).content || [])[0] || 'Messenger'; | 56 | ((notification.title.props || {}).content || [])[0] || 'Messenger'; |