🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Greasy Fork is available in English.

Reddit - remove awards

Removes awards from posts

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

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

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

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

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

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

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

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

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

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

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

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

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

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

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

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name        Reddit - remove awards
// @description Removes awards from posts
// @version     0.1
// @namespace   minirock
// @include     https://*.reddit.com/*
// @grant       none
// ==/UserScript==


function filter() {
    var awards = document.querySelectorAll("span[id*='PostAwardBadges']")

    for (let i = 0; i < awards.length; ++i) {
        awards[i].closest("div").remove()
    }

    //////////////////////////////////

    var give_award = Array.from(document.querySelectorAll('span')).filter(el => el.textContent === 'Give Award');

    for (let i = 0; i < give_award.length; ++i) {
        give_award[i].closest("button").remove()
    }

    ////////////////////////////////////

    var share = document.querySelectorAll("button[data-click-id='share']")

    for (let i = 0; i < share.length; ++i) {
        share[i].closest("div").remove()
    }
}

var mutationObserver = new MutationObserver(function(mutations) {
    filter();
});

mutationObserver.observe(document.documentElement, {
    childList: true,
    subtree: true,
});

filter();



// document.addEventListener("keydown", catch_code, false);

// function catch_code(evt) {
//     if (evt.keyCode === 192) {
//         filter();
//     }
// }