Google-Style Bing + AdBlock

Bing 검색 결과를 Google 스타일로 바꾸고, 광고를 차단합니다

// ==UserScript==
// @name         Google-Style Bing + AdBlock
// @namespace    http://tampermonkey.net/
// @version      1.7
// @description  Bing 검색 결과를 Google 스타일로 바꾸고, 광고를 차단합니다
// @author       lanpod
// @match        *://www.bing.com/*
// @grant        GM_addStyle
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    GM_addStyle(`
        /* 방문한 적 없는 링크 */
        #b_results>li a, h2 a {
            font-weight: normal !important;
            color: #1a59d3 !important; /* Google blue */
        }

        /* 방문한 링크일 경우 */
        a:visited, #b_results>li a:visited {
            color: #6600CC !important; /* Google purple */
        }

        /* 광고 숨김 */
        #b_results .b_ad, /* Bing 광고 섹션 */
        .b_top .b_ad,      /* 상단 광고 */
        .b_ad .b_caption,  /* 광고 설명 */
        .b_ad label,       /* 광고 라벨 */
        .b_ad div          /* 광고 내부 요소 */
        {
            display: none !important;
        }
    `);

    // JavaScript를 이용한 광고 제거
    function removeAds() {
        document.querySelectorAll('.b_ad').forEach(ad => ad.remove());
    }

    // 처음 실행 시 광고 제거
    removeAds();

    // 동적 광고 제거 (MutationObserver 활용)
    const observer = new MutationObserver(() => {
        removeAds();
    });

    observer.observe(document.body, { childList: true, subtree: true });
})();