Skip to content

Instantly share code, notes, and snippets.

@bruab
Created February 4, 2022 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bruab/aef43c804064583b0665bbff7ab8e479 to your computer and use it in GitHub Desktop.
Save bruab/aef43c804064583b0665bbff7ab8e479 to your computer and use it in GitHub Desktop.
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