Greasy Fork

Greasy Fork is available in English.

LinkedInNoPromoted

Removes promoted and suggested posts on LinkedIn

当前为 2023-08-14 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         LinkedInNoPromoted
// @namespace    http://wimgodden.be/
// @version      1.15
// @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();
    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);
}