diff options
author | Vijay A <vraravam@users.noreply.github.com> | 2022-04-18 06:51:50 -0500 |
---|---|---|
committer | Vijay A <vraravam@users.noreply.github.com> | 2022-04-18 06:51:50 -0500 |
commit | 18801ed0c02627e87639dc0848cab44dacc18be2 (patch) | |
tree | 15e56ba66c68bf7b4594e6c9fdef44e037b4be31 /recipes/whatsapp/webview.js | |
parent | Remove deprecated webPreference flag (diff) | |
download | ferdium-recipes-18801ed0c02627e87639dc0848cab44dacc18be2.tar.gz ferdium-recipes-18801ed0c02627e87639dc0848cab44dacc18be2.tar.zst ferdium-recipes-18801ed0c02627e87639dc0848cab44dacc18be2.zip |
Rebranded from 'ferdi' to 'ferdium' (companion changes for the main repo PR #2)
Diffstat (limited to 'recipes/whatsapp/webview.js')
-rw-r--r-- | recipes/whatsapp/webview.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/recipes/whatsapp/webview.js b/recipes/whatsapp/webview.js index b753ad9..3586e14 100644 --- a/recipes/whatsapp/webview.js +++ b/recipes/whatsapp/webview.js | |||
@@ -4,7 +4,7 @@ function _interopRequireDefault(obj) { | |||
4 | return obj && obj.__esModule ? obj : { default: obj }; | 4 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 5 | } |
6 | 6 | ||
7 | module.exports = Ferdi => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | let count = 0; | 9 | let count = 0; |
10 | let indirectCount = 0; | 10 | let indirectCount = 0; |
@@ -18,7 +18,7 @@ module.exports = Ferdi => { | |||
18 | 18 | ||
19 | const unreadSpans = parentChatElem.querySelectorAll('span[aria-label]'); | 19 | const unreadSpans = parentChatElem.querySelectorAll('span[aria-label]'); |
20 | for (const unreadElem of unreadSpans) { | 20 | for (const unreadElem of unreadSpans) { |
21 | const countValue = Ferdi.safeParseInt(unreadElem.textContent); | 21 | const countValue = Ferdium.safeParseInt(unreadElem.textContent); |
22 | if (countValue > 0) { | 22 | if (countValue > 0) { |
23 | if ( | 23 | if ( |
24 | !unreadElem.parentNode.previousSibling || | 24 | !unreadElem.parentNode.previousSibling || |
@@ -33,13 +33,13 @@ module.exports = Ferdi => { | |||
33 | } | 33 | } |
34 | } | 34 | } |
35 | 35 | ||
36 | Ferdi.setBadge(count, indirectCount); | 36 | Ferdium.setBadge(count, indirectCount); |
37 | }; | 37 | }; |
38 | 38 | ||
39 | const getActiveDialogTitle = () => { | 39 | const getActiveDialogTitle = () => { |
40 | const element = document.querySelector('header .emoji-texttt'); | 40 | const element = document.querySelector('header .emoji-texttt'); |
41 | 41 | ||
42 | Ferdi.setDialogTitle(element ? element.textContent : ''); | 42 | Ferdium.setDialogTitle(element ? element.textContent : ''); |
43 | }; | 43 | }; |
44 | 44 | ||
45 | const loopFunc = () => { | 45 | const loopFunc = () => { |
@@ -48,10 +48,10 @@ module.exports = Ferdi => { | |||
48 | }; | 48 | }; |
49 | 49 | ||
50 | window.addEventListener('beforeunload', async () => { | 50 | window.addEventListener('beforeunload', async () => { |
51 | Ferdi.releaseServiceWorkers(); | 51 | Ferdium.releaseServiceWorkers(); |
52 | }); | 52 | }); |
53 | 53 | ||
54 | Ferdi.loop(loopFunc); | 54 | Ferdium.loop(loopFunc); |
55 | 55 | ||
56 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); | 56 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
57 | }; | 57 | }; |