Skip to content

Instantly share code, notes, and snippets.

@MichalSvatos
Created March 21, 2023 14:19
Show Gist options
  • Save MichalSvatos/382119e8c1e04722203158091c43588f to your computer and use it in GitHub Desktop.
Save MichalSvatos/382119e8c1e04722203158091c43588f to your computer and use it in GitHub Desktop.
[Stylus] LinkedIn cleaner
/*
Removed:
- create new post
- likes, reactions, comments
- premium links stuff
- tools
- news
*/
.social-details-social-counts__item,
.news-module,
.share-box-feed-entry__closed-share-box,
.comments-comment-social-bar__action-group .comments-comment-social-bar__reaction-action-button,
.comments-comment-social-bar__reactions-count,
.comments-comment-social-bar__social-counts-separator,
.launchpad-v2,
[class*="premium-upsell-link"],
.global-nav__app-launcher-trigger {
display: none !important;
}
// ==UserScript==
// @name Human sorting
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Switch sorting from "Top" to "Recent"
// @author You
// @match https://www.linkedin.com/feed/
// @icon https://icons.duckduckgo.com/ip2/linkedin.com.ico
// @grant none
// ==/UserScript==
(function() {
'use strict';
setTimeout(() => {
// Getting the sorting button
const sortingButton = document.querySelector("#main div.artdeco-dropdown button[id*='ember']")
if (!sortingButton) return
// Getting the selected option (span)
const sortingTextSpan = sortingButton.querySelector(".t-12.t-bold.mh1")
let sortingText = sortingTextSpan.innerHTML
let sortingTextString = sortingText.trim()
if (sortingTextString !== "Top") return
// Opening the dropdown menu
sortingButton.click()
// Selecting the open dropdown menu
const sortingDropdownContent = sortingButton.nextElementSibling
setTimeout(() => {
if (!sortingDropdownContent) return
const recentOption = sortingDropdownContent.querySelector(".artdeco-dropdown__content-inner > ul > li:last-child > .artdeco-dropdown__item")
recentOption.click()
}, 500)
}, 3000)
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment