屏蔽新版微博的好友点赞过卡片

新版微博首页会显示好友赞过的微博,本脚本删除这些卡片。

// ==UserScript==
// @name         屏蔽新版微博的好友点赞过卡片
// @namespace    https://github.com/easyhard007
// @version      1.0
// @description  新版微博首页会显示好友赞过的微博,本脚本删除这些卡片。
// @author       陈奕男
// @match        https://weibo.com/*
// @icon         https://weibo.com/favicon.ico
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    //删除点赞卡片
    var removeLikeCards = function() {
        var likeTitleList = document.querySelectorAll("span[class='title_title_1DVuO']");
        for (var i = 0; i < likeTitleList.length; i++) {
            likeTitleList[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.remove();
        }
    }
    //监听容器是否发生变化
    var cardContainers = document.querySelectorAll("div[class='Home_feed_3o7ry']");
    if (cardContainers.length>0){
        cardContainers[0].addEventListener("DOMSubtreeModified", function(){
            removeLikeCards();
        }, false);
    }

})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址