From 96b599a779e90c0168a2cf14dbeddfe657a065eb Mon Sep 17 00:00:00 2001 From: marcustyphoon Date: Sun, 27 Oct 2024 13:26:05 -0700 Subject: [PATCH] Tweaks: Improve badge hiding tweak reliability (#1622) --- src/features/tweaks/hide_activity_notification_badge.js | 2 +- src/features/tweaks/hide_communities_notification_badge.js | 2 +- src/features/tweaks/hide_following_notification_badge.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/features/tweaks/hide_activity_notification_badge.js b/src/features/tweaks/hide_activity_notification_badge.js index d6a6e5337..5ee590ded 100644 --- a/src/features/tweaks/hide_activity_notification_badge.js +++ b/src/features/tweaks/hide_activity_notification_badge.js @@ -2,7 +2,7 @@ import { keyToCss } from '../../utils/css_map.js'; import { buildStyle } from '../../utils/interface.js'; import { translate } from '../../utils/language_data.js'; -const activityButton = `button[aria-label="${translate('Activity')}"]`; +const activityButton = ':is(button, li):has(use[href="#managed-icon__lightning"])'; const mobileMenuButton = `button[aria-label="${translate('Menu')}"]`; export const styleElement = buildStyle(` diff --git a/src/features/tweaks/hide_communities_notification_badge.js b/src/features/tweaks/hide_communities_notification_badge.js index 8da68c3d4..8971d0563 100644 --- a/src/features/tweaks/hide_communities_notification_badge.js +++ b/src/features/tweaks/hide_communities_notification_badge.js @@ -2,7 +2,7 @@ import { keyToCss } from '../../utils/css_map.js'; import { buildStyle } from '../../utils/interface.js'; import { translate } from '../../utils/language_data.js'; -const communitiesButton = `button[aria-label="${translate('Communities')}"]`; +const communitiesButton = ':is(button, li):has(use[href="#managed-icon__communities"])'; const mobileMenuButton = `button[aria-label="${translate('Menu')}"]`; export const styleElement = buildStyle(` diff --git a/src/features/tweaks/hide_following_notification_badge.js b/src/features/tweaks/hide_following_notification_badge.js index f3a649916..28708a4d7 100644 --- a/src/features/tweaks/hide_following_notification_badge.js +++ b/src/features/tweaks/hide_following_notification_badge.js @@ -4,7 +4,7 @@ import { buildStyle } from '../../utils/interface.js'; import { translate } from '../../utils/language_data.js'; import { pageModifications } from '../../utils/mutations.js'; -const followingHomeButton = `:is(li[title="${translate('Home')}"], button[aria-label="${translate('Home')}"], a[href="/dashboard/following"])`; +const followingHomeButton = `:is(li[title="${translate('Home')}"], button[aria-label="${translate('Home')}"], a[href="/dashboard/following"], a[href="/dashboard"])`; const mobileMenuButton = `button[aria-label="${translate('Menu')}"]`; const customTitleElement = dom('title', { 'data-xkit': true });