Force Text Copying Enhanced

Force-enable text copying across more browsers

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Force Text Copying Enhanced
// @namespace    https://viayoo.com/
// @version      0.2
// @description  Force-enable text copying across more browsers
// @author       You
// @run-at       document-end
// @match        https://*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Apply user-select: text to all elements with different prefixes and standard property
    document.querySelectorAll("*").forEach(function(el) {
        el.style.webkitUserSelect = 'text'; // For WebKit browsers (Chrome, Safari) [cite: 2]
        el.style.mozUserSelect = 'text';    // For Firefox
        el.style.msUserSelect = 'text';     // For Internet Explorer/Edge (older versions)
        el.style.userSelect = 'text';       // Standard property
    });

    // --- Optional: Attempt to re-enable copy/cut events ---
    // This part is more complex and might not work on all sites or could cause unintended side effects.
    // Use with caution and test thoroughly.

    /*
    document.addEventListener('copy', enableCopy);
    document.addEventListener('cut', enableCopy);
    document.addEventListener('selectstart', enableCopy);

    function enableCopy(e) {
        e.stopPropagation(); // Stop the event from propagating up the DOM tree
        // In some cases, you might need to explicitly set the clipboard data,
        // but stopping propagation is often enough to prevent sites from blocking the default action.
    }
    */

})();