Skip to content

Instantly share code, notes, and snippets.

@bruab
Created Feb 4, 2022
Embed
What would you like to do?
Tampermonkey userscript to hide sidebars, DMs, feed, and notifications when you visit https://www.linkedin.com/feed/?poast
// ==UserScript==
// @name LinkedIn | Hide sidebars
// @namespace https://briandavidhall.com
// @version 0.1
// @description remove distractions on linkedin so i can poast
// @author You
// @match https://www.linkedin.com/feed/?poast
// @grant none
// ==/UserScript==
(function() {
var toHide = [
'.scaffold-layout__aside', // right sidebar
'.scaffold-layout__sidebar', // left sidebar
'#msg-overlay', // messages
'div.scaffold-finite-scroll--infinite', // timeline
'[href="/notifications/"] .notification-badge', // top nav > notifications badge
'[href="/messaging/"] .notification-badge' // top nav > messages badge
];
toHide.forEach(hide);
function hide(selector) {
var element = document.querySelector(selector);
if (!element) return setTimeout(function () { hide(selector); }, 100);
element.style.visibility = 'hidden';
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment