Enable Copy Everywhere

Enable copy and text selection on all websites including right click

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name              Enable Copy Everywhere
// @namespace         https://greasyfork.org/en/users/1375891-wibu-elite
// @version           1.0
// @description       Enable copy and text selection on all websites including right click
// @author            Kinnena
// @match             *://*/*
// @icon              https://img.icons8.com/?size=160&id=XR4FYU3AnFyS&format=png
// @grant             none
// @license MIT
// @run-at            document-start
// ==/UserScript==

(function() {
    'use strict';

    // 1. Enable text selection via CSS
    const style = document.createElement('style');
    style.innerHTML = `
        * {
            user-select: text !important;
            -webkit-user-select: text !important;
            -ms-user-select: text !important;
        }
    `;
    document.head.appendChild(style);

    // 2. Remove event listeners that block copy
    const events = [
        'copy',
        'cut',
        'paste',
        'contextmenu',
        'selectstart',
        'mousedown',
        'mouseup',
        'keydown'
    ];

    events.forEach(event => {
        document.addEventListener(event, e => {
            e.stopPropagation();
        }, true);
    });

    // 3. Enable right click explicitly
    document.oncontextmenu = null;

    // 4. Remove inline handlers
    const all = document.querySelectorAll('*');
    all.forEach(el => {
        el.oncopy = null;
        el.oncut = null;
        el.onpaste = null;
        el.oncontextmenu = null;
        el.onselectstart = null;
        el.onmousedown = null;
    });

})();