bing搜索去除CSDN

bing搜索结果去除CSDN

// ==UserScript==
// @name         bing搜索去除CSDN
// @namespace    http://tampermonkey.net/
// @version      2024-07-09
// @description  bing搜索结果去除CSDN
// @author       bytebuf
// @match        *://*.bing.com/*
// @icon         https://th.bing.com/th/id/OIP.F714JC_Yqnw0GNto5jK4fgHaFj?rs=1&pid=ImgDetMain
// @grant        none
// @run-at       document-end
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    (function() {
        document.querySelectorAll('#b_results > li').forEach(item => {
            const link = item.querySelector('a');
            if(link !== null) {
                const isCSDN = link.getAttribute('href').indexOf('csdn.net') !== -1;
                if(isCSDN) {
                    item.remove();
                }
            }
        })
    })();
})();