Greasy Fork

Greasy Fork is available in English.

Chzzk_Clips: Unblock & Unmute

차단한 유저의 클립 우회 시청 및 음소거 해제

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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Chzzk_Clips: Unblock & Unmute
// @namespace    Chzzk_Clips: Unblock & Unmute
// @version      1.1.1
// @description  차단한 유저의 클립 우회 시청 및 음소거 해제
// @author       DOGJIP
// @match        https://chzzk.naver.com/*
// @match        https://*.chzzk.naver.com/*
// @match        https://m.naver.com/shorts/*
// @run-at       document-start
// @grant        none
// @require      https://unpkg.com/xhook@latest/dist/xhook.min.js
// @icon         https://www.google.com/s2/favicons?sz=64&domain=chzzk.naver.com
// ==/UserScript==

(function() {
  'use strict';

  const host = location.host;

  // 1) chzzk.naver.com 에서 Clips API 차단 해제
  if (host.endsWith('chzzk.naver.com')) {
    xhook.after((request, response) => {
      const url = request.url;

      // 목록 API (/clips?filterType=ALL)
      if (url.includes('/clips?') && url.includes('filterType=ALL')) {
        try {
          const json = JSON.parse(response.text);
          if (json.content && Array.isArray(json.content.data)) {
            json.content.data.forEach(clip => {
              clip.privateUserBlock = false;
              if (clip.blindType) clip.blindType = null;
            });
            response.text = JSON.stringify(json);
          }
        } catch (e) { /* silent */ }
      }

      // 상세 API (/clips/{id}/detail?optionalProperties=...)
      if (url.match(/\/clips\/[^/]+\/detail\?optionalProperties=/)) {
        try {
          const json = JSON.parse(response.text);
          const op = json.content && json.content.optionalProperty;
          if (op) {
            op.privateUserBlock = false;
            if (op.blindType) op.blindType = null;
            response.text = JSON.stringify(json);
          }
        } catch (e) { /* silent */ }
      }
    });

    return;
  }

  // ——————————————————————————————
  // 2) m.naver.com/shorts 에서 자동 언뮤트
  if (host === 'm.naver.com') {
    const tryClickUnmute = () => {
      const btn = document.querySelector('button.si_btn_sound');
      if (btn && btn.getAttribute('aria-pressed') === 'true') {
        btn.click();
        return true;
      }
      return false;
    };

    const loop = () => {
      if (!tryClickUnmute()) requestAnimationFrame(loop);
    };

    // DOMContentLoaded 이전에도 동작하도록 즉시 호출
    document.addEventListener('DOMContentLoaded', () => {
      loop();
    });
  }

})();