Greasy Fork is available in English.

Filter CSDN Content from Bing and Baidu

Filter out CSDN content from Bing and Baidu search results

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==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);
})();