Skip to content

Commit

Permalink
use single observer
Browse files Browse the repository at this point in the history
  • Loading branch information
marcustyphoon committed Sep 11, 2024
1 parent 88a3379 commit 848e6de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/features/tweaks/hide_following_notification_badge.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ const onTitleChanged = () => {
const newTitle = rawTitle.replace(/^\(\d{1,2}\) /, '');
customTitleElement.textContent = newTitle;

new MutationObserver(onTitleChanged).observe(titleElement, { characterData: true, subtree: true });
observer.observe(titleElement, { characterData: true, subtree: true });
};
const observer = new MutationObserver(onTitleChanged);

export const main = async () => {
pageModifications.register('head title:not([data-xkit])', onTitleChanged);
Expand Down

0 comments on commit 848e6de

Please sign in to comment.