LinkedInNoPromoted

Removes promoted and suggested posts on LinkedIn

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         LinkedInNoPromoted
// @namespace    http://wimgodden.be/
// @version      1.16
// @description  Removes promoted and suggested posts on LinkedIn
// @author       Wim Godden <[email protected]>
// @match        https://linkedin.com/*
// @match        https://www.linkedin.com/*
// @grant        none
// @require      https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// ==/UserScript==



function removeSponsored() {
    $("div div div span.update-components-header__text-view div span span:contains('Suggested')").parent().parent().parent().parent().parent().parent().hide();
    $("div.ember-view a div span div span span.ember-view span:contains('Promoted')").parent().parent().parent().parent().parent().parent().parent().parent().hide()
    $("span:contains('Promoted')").parent().parent().parent().parent().parent().parent().remove();
    $("span:contains('Expert answers on')").parent().parent().parent().parent().parent().parent().remove();
    $("span.update-components-header__text-view:contains('Suggested')").parent().parent().parent().parent().parent().parent().remove();
    setTimeout(function() {
        removeSponsored();
    }, 1000); //Two seconds will elapse and Code will execute.
}

function removeSponsoredTimer($) {
    setTimeout(function() {
        removeSponsored();
    }, 1000); //Two seconds will elapse and Code will execute.
}

if (typeof jQuery === "function") {
    $(function() {
        removeSponsoredTimer (jQuery);
    });
}
else {
    add_jQuery (removeSponsoredTimer, "1.7.2");
}

function add_jQuery (callbackFn, jqVersion) {
    var jqVersion   = jqVersion || "1.7.2";
    var D           = document;
    var targ        = D.getElementsByTagName ('head')[0] || D.body || D.documentElement;
    var scriptNode  = D.createElement ('script');
    scriptNode.src  = 'http://ajax.googleapis.com/ajax/libs/jquery/'
                    + jqVersion
                    + '/jquery.min.js'
                    ;
    scriptNode.addEventListener ("load", function () {
        var scriptNode          = D.createElement ("script");
        scriptNode.textContent  =
            'var gm_jQuery  = jQuery.noConflict (true);\n'
            + '(' + callbackFn.toString () + ')(gm_jQuery);'
        ;
        targ.appendChild (scriptNode);
    }, false);
    targ.appendChild (scriptNode);
}