나무위키 광고 삭제

2025. 3. 26. 오후 12:35:46

当前为 2025-03-26 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        나무위키 광고 삭제
// @namespace   Violentmonkey Scripts
// @icon        https://t2.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=http://namu.wiki
// @match       https://namu.wiki/*
// @run-at      document-end
// @grant       none
// @version     1.0
// @author      Xlbatross
// @description 2025. 3. 26. 오후 12:35:46
// ==/UserScript==

const observer = new MutationObserver(mutations => {
    mutations.forEach(() => {
        // 나무위키 파워링크 삭제 (class : LBjkIL12, Emxr1Fw8)
        // 나무위키 상단 이미지 삭제 (class : W-W1lQk)
        // 나무위키 구글 광고 이미지 삭제 (attribute : data-google-query-id)
        document.querySelectorAll('[class*="LBjkIL12"], [class*="Emxr1Fw8"], [class*="W-W1lQk-"], [data-google-query-id]').forEach(element => {
            element.remove();
        });
    });
});
observer.observe(document.body, { childList: true, subtree: true });