From 6ad22f4a44d2f1dd9178a51422d01bd9d3faaae4 Mon Sep 17 00:00:00 2001 From: Joni Van Roost Date: Wed, 20 Feb 2019 07:50:57 +0100 Subject: [PATCH] Add option to block delivery receipts (#793) Fixes #699 --- source/config.ts | 3 ++- source/index.ts | 4 ++++ source/menu.ts | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/source/config.ts b/source/config.ts index 9f1ff1be8..e9a94861a 100644 --- a/source/config.ts +++ b/source/config.ts @@ -25,7 +25,8 @@ const defaults = { flashWindowOnMessage: true, block: { chatSeen: false, - typingIndicator: false + typingIndicator: false, + deliveryReceipt: false }, emojiStyle: 'facebook-3-0' as EmojiStyle, confirmImagePaste: true, diff --git a/source/index.ts b/source/index.ts index 8cb8d2362..9146df39b 100644 --- a/source/index.ts +++ b/source/index.ts @@ -169,6 +169,8 @@ function initRequestsFiltering(): void { urls: [ `*://*.${domain}/*typ.php*`, // Type indicator blocker `*://*.${domain}/*change_read_status.php*`, // Seen indicator blocker + `*://*.${domain}/*delivery_receipts*`, // Delivery receipts indicator blocker + `*://*.${domain}/*unread_threads*`, // Delivery receipts indicator blocker '*://*.fbcdn.net/images/emoji.php/v9/*', // Emoji '*://*.facebook.com/images/emoji.php/v9/*' // Emoji ] @@ -181,6 +183,8 @@ function initRequestsFiltering(): void { callback({cancel: config.get('block.typingIndicator')}); } else if (url.includes('change_read_status.php')) { callback({cancel: config.get('block.chatSeen')}); + } else if (url.includes('delivery_receipts') || url.includes('unread_threads')) { + callback({cancel: config.get('block.deliveryReceipt')}); } }); } diff --git a/source/menu.ts b/source/menu.ts index ce13bfa36..4de3cce68 100644 --- a/source/menu.ts +++ b/source/menu.ts @@ -171,6 +171,14 @@ Press Command/Ctrl+R in Caprine to see your changes. config.set('block.typingIndicator', item.checked); } }, + { + type: 'checkbox', + label: 'Block Delivery Receipts', + checked: config.get('block.deliveryReceipt'), + click(item) { + config.set('block.deliveryReceipt', item.checked); + } + }, { label: 'Hardware Acceleration', type: 'checkbox',