aboutsummaryrefslogtreecommitdiffstats
path: root/recipes
diff options
context:
space:
mode:
authorLibravatar Clayton <clayton.belcher@gmail.com>2024-01-07 18:54:34 -0500
committerLibravatar GitHub <noreply@github.com>2024-01-07 23:54:34 +0000
commit92365fe15672abe06bcf19a9648114836972ba80 (patch)
treeb443b0f81caa68d30b8d3ab949a15915527a5dc5 /recipes
parentadd Lillecarl as a contributor for code (#492) (diff)
downloadferdium-recipes-92365fe15672abe06bcf19a9648114836972ba80.tar.gz
ferdium-recipes-92365fe15672abe06bcf19a9648114836972ba80.tar.zst
ferdium-recipes-92365fe15672abe06bcf19a9648114836972ba80.zip
Update GroupMe DOM filtering to use latest web app conventions (#465)
* Update filtering to use latest web app conventions * Fix version * fix issue with build (pnpm validate) --------- Co-authored-by: AndreĢ Oliveira <oliveira.andrerodrigues95@gmail.com>
Diffstat (limited to 'recipes')
-rw-r--r--recipes/groupme/package.json2
-rw-r--r--recipes/groupme/webview.js16
2 files changed, 8 insertions, 10 deletions
diff --git a/recipes/groupme/package.json b/recipes/groupme/package.json
index f282c9a..06c02b1 100644
--- a/recipes/groupme/package.json
+++ b/recipes/groupme/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "groupme", 2 "id": "groupme",
3 "name": "GroupMe", 3 "name": "GroupMe",
4 "version": "1.3.0", 4 "version": "1.3.1",
5 "license": "MIT", 5 "license": "MIT",
6 "config": { 6 "config": {
7 "serviceURL": "https://web.groupme.com", 7 "serviceURL": "https://web.groupme.com",
diff --git a/recipes/groupme/webview.js b/recipes/groupme/webview.js
index 0f0d3a6..680f12e 100644
--- a/recipes/groupme/webview.js
+++ b/recipes/groupme/webview.js
@@ -7,20 +7,18 @@ const _path = _interopRequireDefault(require('path'));
7module.exports = Ferdium => { 7module.exports = Ferdium => {
8 const getMessages = () => { 8 const getMessages = () => {
9 // array-ify the list of conversations 9 // array-ify the list of conversations
10 const allConversations = [ 10 const unreadConversations = [
11 ...document.querySelectorAll('#tray .tray-list .list-item'), 11 ...document.querySelectorAll('#tray .tray-list .list-item.unread'),
12 ]; 12 ];
13 // for each conversation on the list... 13 // for each conversation on the list...
14 const filteredConversations = allConversations.filter(e => { 14 const filteredConversations = unreadConversations.filter(e => {
15 // keep it on the list if [1] it has unread messages (not .ng-hide), and [2] it isn't muted (not .overlay) 15 // keep it on the list if it isn't muted (not .muted)
16 return ( 16 return !e.innerHTML.includes('muted');
17 !e.innerHTML.includes('ng-hide') && !e.innerHTML.includes('overlay')
18 );
19 }); 17 });
20 const unreadConversations = filteredConversations.length; 18 const unreadUnmutedConversations = filteredConversations.length;
21 19
22 // set Ferdium badge 20 // set Ferdium badge
23 Ferdium.setBadge(unreadConversations); 21 Ferdium.setBadge(unreadUnmutedConversations);
24 }; 22 };
25 23
26 Ferdium.loop(getMessages); 24 Ferdium.loop(getMessages);