// ==UserScript==
// @name 네이버 웨일 권유·화상회의 배너 숨기기
// @namespace local.naver.declutter
// @version 1.0
// @match https://www.naver.com/*
// @run-at document-start
// @grant none
// ==/UserScript==
(function () {
'use strict';
// 숨길 배너를 식별하는 문구 (여기만 고치면 대상 추가/제거 가능)
const PHRASES = ['브라우저를 업데이트', '무료 무제한 화상회의', '웨일', '화상회의'];
const hide = (el) => el && el.style.setProperty('display', 'none', 'important');
function sweep() {
document.querySelectorAll('div, section, aside, header, a').forEach((el) => {
const t = el.textContent || '';
if (t.length > 100) return; // 큰 컨테이너(본문) 오탐 방지
if (!PHRASES.some((p) => t.includes(p))) return;
// 배너 wrapper까지 한두 단계 올라가서 통째로 숨김
let target = el;
for (let i = 0; i < 2 && target.parentElement; i++) {
if ((target.parentElement.textContent || '').length < 150) target = target.parentElement;
else break;
}
hide(target);
});
}
// 초기 실행 + 동적으로 끼어드는 배너 대응 (디바운스)
let scheduled = false;
const run = () => { try { sweep(); } catch (e) {} };
const schedule = () => {
if (scheduled) return;
scheduled = true;
requestAnimationFrame(() => { scheduled = false; run(); });
};
document.addEventListener('DOMContentLoaded', run);
new MutationObserver(schedule).observe(document.documentElement, { childList: true, subtree: true });
run();
})();
저는 코딩할줄 잘 몰라서 진1동코딩 하니까 잘 해주네요
댓글 0