再见了百度知道和百家号搜索结果

删除百度搜索结果的百度知道和百家号结果

当前为 2018-09-28 提交的版本,查看 最新版本

// ==UserScript==
// @name         再见了百度知道和百家号搜索结果
// @namespace    http://tampermonkey.net/
// @home-url     https://gf.qytechs.cn/zh-CN/scripts/371691
// @description  删除百度搜索结果的百度知道和百家号结果
// @version      0.7
// @include      http://www.baidu.com/*
// @include      https://www.baidu.com/*
// @author       vessl
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';
    // Your code here...
    var hostname = window.location.hostname;
    
    if (hostname == 'www.baidu.com') {
       // process();
        document.addEventListener("DOMSubtreeModified", process);
    }
    function process() {
        var results = document.getElementById('content_left');
       // console.log(results)

            for (var i = results.children.length - 1; i >= 0; i--) {
                var links = results.children[i].getElementsByClassName('c-showurl');
                if (links && links.length > 0) {
                    var link = links[0];
                    var text = link.innerText;
                    if (text && (text.indexOf('zhidao.baidu') > -1 || text.indexOf('baijia')) > -1){
                        results.children[i].parentNode.removeChild(results.children[i]);
                    }
                }
            }

    }
})();

QingJ © 2025

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