Greasy Fork is available in English.

Enable Copy Everywhere

Enable copy and text selection on all websites including right click

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey to install this script.

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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;
    });

})();