Skip to content

Instantly share code, notes, and snippets.

@NickTomlin
Last active March 12, 2025 18:10
Show Gist options
  • Save NickTomlin/9f5708c1fa2c7e40334fabee6ec0a2fb to your computer and use it in GitHub Desktop.
Save NickTomlin/9f5708c1fa2c7e40334fabee6ec0a2fb to your computer and use it in GitHub Desktop.
LinkedIn notification hider tampermonkey

LinkedIn notifications are almost entirely useless, and this helps avoid wasting willpower trying to make the red counter go away or actually checking them.

Inspired (and complemented) by this script.

// ==UserScript==
// @name Hide LinkedIn notifications
// @namespace https://nick-tomlin.com/
// @version 0.1
// @description Hides LinkedIn "notification" updates (which drive engagement by spamming you with meaningless info about your Network). Based off of https://gist.github.com/JesperDramsch/839365c85133927f694bf5113c77a2f1
// @author Nick Tomlin
// @match https://www.linkedin.com/*
// @exclude https://www.linkedin.com/notifications*
// @grant none
// @downloadURL none
// @updateURL none
// ==/UserScript==
(function() {
'use strict';
function addCss(css) {
var head = document.head || document.getElementsByTagName('head')[0],
style = document.createElement('style');
style.type = 'text/css';
style.appendChild(document.createTextNode(css));
head.appendChild(style);
}
// Hide a css selector element
function hideElement(css_selectors) {
const elements = css_selectors.join(', ')
addCss(`${elements} {visibility:hidden;}`);
}
hideElement([`a[href^="https://www.linkedin.com/notifications/"] .notification-badge`]);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment