移除知乎热门(remove zhihu top story)

try to take over the world!

目前為 2018-04-27 提交的版本,檢視 最新版本

// ==UserScript==
// @name         移除知乎热门(remove zhihu top story)
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       rainyleo
// @match        https://www.zhihu.com/
// @grant        none
// ==/UserScript==
(function() {
    'use strict';
    function remove() {
        const items = [...document.querySelectorAll('.TopstoryItem')];
        if (items.length) {
            for (const item of items) {
                const title = item.querySelector('.FeedSource-firstline');
                if (title && title.textContent.includes('热门内容')) {
                    item.remove();
                }
            }
        }
    }
    remove();

    const container = document.querySelector(".TopstoryMain >div");
    const ob = new MutationObserver(remove);
    const config = { childList: true };
    ob.observe(container, config);

})();

QingJ © 2025

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