Greasy Fork

Greasy Fork is available in English.

Chzzk 샤프닝 필터 (기본 OFF, 콘솔 제어)

Chzzk 방송 비디오에 아주 약한 선명도 필터를 수동 적용

当前为 2025-05-04 提交的版本,查看 最新版本

// ==UserScript==
// @name         Chzzk 샤프닝 필터 (기본 OFF, 콘솔 제어)
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Chzzk 방송 비디오에 아주 약한 선명도 필터를 수동 적용
// @match        https://chzzk.naver.com/*
// @icon         https://chzzk.naver.com/favicon.ico
// @grant        none
// @run-at       document-idle
// @license      MIT
// ==/UserScript==

(() => {
  const FILTER_ID = 'sharpnessFilter';
  const STYLE_ID = 'sharpnessStyle';
  const SVG_WRAPPER_ID = 'sharpnessSVGContainer';

  const createSVGFilter = () => {
    const svg = document.createElement('div');
    svg.id = SVG_WRAPPER_ID;
    svg.innerHTML = `
      <svg xmlns="http://www.w3.org/2000/svg" style="position:absolute;width:0;height:0;">
        <filter id="${FILTER_ID}">
          <feConvolveMatrix order="3" kernelMatrix="
            0   -0.1  0
           -0.1  1.6 -0.1
            0   -0.1  0
          " divisor="1"/>
        </filter>
      </svg>
    `;
    return svg;
  };

  const createStyle = () => {
    const style = document.createElement('style');
    style.id = STYLE_ID;
    style.textContent = `
      .pzp-pc .webplayer-internal-video {
        filter: url(#${FILTER_ID}) !important;
      }
    `;
    return style;
  };

  // 전역 제어 API
  window.sharpnessFilter = {
    enabled: false,
    enable() {
      if (this.enabled) return;
      document.body.appendChild(createSVGFilter());
      document.head.appendChild(createStyle());
      this.enabled = true;
      console.log('%c[🟢 선명함 필터 켜짐]', 'color:green;font-weight:bold;');
    },
    disable() {
      document.getElementById(STYLE_ID)?.remove();
      document.getElementById(SVG_WRAPPER_ID)?.remove();
      this.enabled = false;
      console.log('%c[🔘 선명함 필터 꺼짐]', 'color:gray;font-weight:bold;');
    },
    toggle() {
      this[this.enabled ? 'disable' : 'enable']();
    }
  };

  console.log('%c[🔧 Chzzk 샤프닝 필터 준비 완료 (기본 OFF)]', 'color:skyblue; font-weight:bold;');
  console.log('👉 사용법: sharpnessFilter.enable(), disable(), toggle()');
})();