aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/whatsapp
diff options
context:
space:
mode:
authorLibravatar Vijay A <vraravam@users.noreply.github.com>2022-04-18 06:51:50 -0500
committerLibravatar Vijay A <vraravam@users.noreply.github.com>2022-04-18 06:51:50 -0500
commit18801ed0c02627e87639dc0848cab44dacc18be2 (patch)
tree15e56ba66c68bf7b4594e6c9fdef44e037b4be31 /recipes/whatsapp
parentRemove deprecated webPreference flag (diff)
downloadferdium-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')
-rw-r--r--recipes/whatsapp/index.js6
-rw-r--r--recipes/whatsapp/package.json2
-rw-r--r--recipes/whatsapp/webview.js14
3 files changed, 11 insertions, 11 deletions
diff --git a/recipes/whatsapp/index.js b/recipes/whatsapp/index.js
index 4caf116..80eaf51 100644
--- a/recipes/whatsapp/index.js
+++ b/recipes/whatsapp/index.js
@@ -1,13 +1,13 @@
1module.exports = (Ferdi) => class Messenger extends Ferdi { 1module.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
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(/(Ferdium|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 d93eb3e..5d0f001 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.3.7", 4 "version": "3.4.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 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
7module.exports = Ferdi => { 7module.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};