Greasy Fork

来自缓存

Greasy Fork is available in English.

Soop(숲) 채팅 드래그 활성화 (초코)

생방송 채팅을 일반 텍스트처럼 자유롭게 드래그하고 복사할 수 있게 합니다.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Soop(숲) 채팅 드래그 활성화 (초코)
// @namespace    http://tampermonkey.net/
// @version      3.0
// @license      MIT
// @icon         https://res.sooplive.com/afreeca.ico
// @description  생방송 채팅을 일반 텍스트처럼 자유롭게 드래그하고 복사할 수 있게 합니다.
// @author       초코
// @match        *://play.sooplive.com/*
// @match        *://*.sooplive.com/*
// @run-at       document-end
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // 1. 드래그를 막는 모든 설정 강제 해제 (CSS 방식)
    const style = document.createElement('style');
    style.innerHTML = `
        #chat_area, #chat_area *, .chat-message, .chat-message * {
            user-select: text !important;
            -webkit-user-select: text !important;
            -moz-user-select: text !important;
            -ms-user-select: text !important;
            cursor: auto !important;
        }
    `;
    document.head.appendChild(style);

    // 2. 자바스크립트로 막아놓은 드래그 방지 이벤트 무력화
    const unlockSelection = () => {
        const chatArea = document.querySelector('#chat_area') || document.body;

        // 드래그나 선택을 방해하는 이벤트들을 가로채서 무시함
        chatArea.onselectstart = () => true;
        chatArea.onmousedown = () => true;
    };

    // 1초마다 한 번씩 확인해서 드래그 권한을 유지함
    setInterval(unlockSelection, 1000);

    console.log("초코의 드래그 활성화 모드 가동! 이제 마음껏 긁으세요. 😎");
})();