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.
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`]); | |
})(); |