Filter CSDN Content from Bing and Baidu

Filter out CSDN content from Bing and Baidu search results

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Filter CSDN Content from Bing and Baidu
// @namespace    http://tampermonkey.net/
// @version      2024-12-05
// @description  Filter out CSDN content from Bing and Baidu search results
// @author       You
// @match        https://www.bing.com/search?q=*
// @match        https://www.baidu.com/s?wd=*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=bing.com
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // Function to remove CSDN results
    function removeCSDNResults() {
        const results = document.querySelectorAll('.b_algo, .b_sideBleed, .b_footnote, .result');
        results.forEach(result => {
            const link = result.querySelector('a');
            // Filter for Bing results
            if (link && link.href.includes('csdn.net')) {
                result.style.display = 'none';
            }
            // Filter for Baidu results
            const muAttr = result.getAttribute('mu');
            if (muAttr && muAttr.includes('csdn.net')) {
                result.style.display = 'none';
            }
        });
    }

    // Run the function after the page loads
    window.addEventListener('load', removeCSDNResults);
})();