Skip to content

Instantly share code, notes, and snippets.

@henrik242
Last active March 18, 2026 14:53
Show Gist options
  • Select an option

  • Save henrik242/b7c392975a263be618ed0361b67ecc6e to your computer and use it in GitHub Desktop.

Select an option

Save henrik242/b7c392975a263be618ed0361b67ecc6e to your computer and use it in GitHub Desktop.
Tampermonkey script to hide the GitHub notification dot
// ==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