Greasy Fork is available in English.

还原对于选中复制限制

还原对于选中复制限制,通杀大部分网站

// ==UserScript==
// @name        还原对于选中复制限制
// @name:en     Remove the limitation on copy and selection
// @namespace   Violentmonkey Scripts
// @match       *://*/*
// @grant       none
// @version     1.1
// @author      wray
// @license     GPLV3
// @description 还原对于选中复制限制,通杀大部分网站
// @description:en Remove the limitation on copy and selection. suitable for almost all websites
// ==/UserScript==

(function () {
    /**
     * 还原所有修改
     */
    const fixAll = function () {
        function fixChanges() {
            // 修复选中限制
            const styleTag = document.createElement('style');
            styleTag.innerHTML = '* {user-select: auto !important;}';
            document.head.appendChild(styleTag);
            // 修复按键限制
            ['onkeyup', 'onkeydown', 'onkeypress', 'onmousedown', 'onselectstart', 'oncontextmenu'].forEach(event => {
                window[event] = null;
                document[event] = null;
            });
            // 清空计时器
            window.clearInterval(fixChangesInterval);
        }
        const fixChangesInterval = window.setInterval(fixChanges, window.Math.ceil(Math.random() * 128));
    };
    window.onload = fixAll;
    window.addEventListener('popstate', fixAll);
    window.addEventListener('hashchange', fixAll);
})();