From 6a7930367ad6fa4a0adb434abfa3e039fc51d8e0 Mon Sep 17 00:00:00 2001 From: TFWol <9045213+TFWol@users.noreply.github.com> Date: Mon, 14 Aug 2023 15:17:38 -0700 Subject: [PATCH 1/2] Make github-title-notification.user.js work with new github layout Makes the notification work even if switched over to the new Global Navigation Update feature. --- github-title-notification.user.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/github-title-notification.user.js b/github-title-notification.user.js index 9459cb0..56b9d6f 100644 --- a/github-title-notification.user.js +++ b/github-title-notification.user.js @@ -27,7 +27,10 @@ function check() { let title = document.title, mail = document.querySelector(".mail-status"), - hasUnread = mail ? !mail.hidden : false; + notificationButton = document.querySelector("#AppHeader-notifications-button"), //for new layout + hasUnreadMail = mail ? !mail.hidden : false, + hasIndicator = notificationButton ? notificationButton.classList.contains("AppHeader-button--hasIndicator") : false, + hasUnread = hasUnreadMail || hasIndicator; // if (!/^\(\d+\)/.test(title)) { title = title.replace(/^(\([^)]+\)\s)*/g, ""); From 1f3a94b3ea58361f9fe780014d207c1313e8ef80 Mon Sep 17 00:00:00 2001 From: TFWol <9045213+TFWol@users.noreply.github.com> Date: Mon, 14 Aug 2023 15:25:58 -0700 Subject: [PATCH 2/2] Bump github-title-notification.user.js version --- github-title-notification.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github-title-notification.user.js b/github-title-notification.user.js index 56b9d6f..b78108d 100644 --- a/github-title-notification.user.js +++ b/github-title-notification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name GitHub Title Notification -// @version 1.0.7 +// @version 1.0.8 // @description A userscript that changes the document title if there are unread messages // @license MIT // @author Rob Garrison