Skip to content

Instantly share code, notes, and snippets.

@IoIxD
Last active March 10, 2023 05:52
Show Gist options
  • Save IoIxD/42725696c469657e6891fdd93c2302e6 to your computer and use it in GitHub Desktop.
Save IoIxD/42725696c469657e6891fdd93c2302e6 to your computer and use it in GitHub Desktop.
Javascript that removes extra Linkedin posts from feed other then reposts. Requires the Tampermonkey extension.
// ==UserScript==
// @name RemoveLinkedinExtra
// @author ioi
// @match https://www.linkedin.com/feed/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=linkedin.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
window.setInterval(function(){
let statuses = document.querySelectorAll(".feed-shared-update-v2");
statuses.forEach(function (status) {
let topbar = status.querySelector(".update-components-header");
if(topbar) {
let relevant = topbar.innerHTML.includes("posted this");
if(!relevant) {
status.remove();
}
}
});
},1000);
// Your code here...
})();
/*
BONUS: CSS that removes the notification badge from the home tab.
.global-nav__primary-link-notif .notification-badge {
display: none!important;
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment