Last active
March 18, 2026 14:53
-
-
Save henrik242/b7c392975a263be618ed0361b67ecc6e to your computer and use it in GitHub Desktop.
Tampermonkey script to hide the GitHub notification dot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Hide GitHub Notification Dot | |
| // @namespace https://github.com/henrik242 | |
| // @version 1.2 | |
| // @description Hides the phantom unread notification indicator dot on GitHub when indicatorMode is "none" | |
| // @match https://github.com/* | |
| // @match https://gist.github.com/* | |
| // @grant GM_addStyle | |
| // @run-at document-end | |
| // ==/UserScript== | |
| (function () { | |
| 'use strict'; | |
| function hideNewHeader() { | |
| // New React-based header (github.com) | |
| const partial = document.querySelector('react-partial[partial-name="global-nav-bar"] script[data-target="react-partial.embeddedData"]'); | |
| if (!partial) return false; | |
| try { | |
| const data = JSON.parse(partial.textContent); | |
| if (data.props.notifications.indicatorMode === 'none') { | |
| GM_addStyle(` | |
| a[class*="notificationIndicator"]::after, | |
| a[class*="notificationIndicator"]::before { | |
| display: none !important; | |
| } | |
| `); | |
| } | |
| } catch (e) { | |
| // JSON parse failed | |
| } | |
| return true; | |
| } | |
| function hideOldHeader() { | |
| // Old header (gist.github.com) | |
| const indicator = document.querySelector('notification-indicator'); | |
| if (!indicator) return false; | |
| GM_addStyle(` | |
| .mail-status.unread { | |
| display: none !important; | |
| } | |
| `); | |
| return true; | |
| } | |
| hideNewHeader() || hideOldHeader(); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment