您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
解除复制限制...
// ==UserScript== // @name 解除复制限制1 // @name:en 解除复制限制. // @name:zh-CN 解除复制限制 // @namespace https://palerock.cn // @version 0.01 // @description:en 解除复制限制en.. // @description:zh-CN 解除复制限制... // @require https://greasyfork.org/scripts/372672-everything-hook/code/Everything-Hook.js?version=659315 // @include * // @author qi_liu // @match http://*/* // @run-at document-start // @grant none // @description 解除复制限制 // @license MIT // ==/UserScript== 'use strict'; (function (global) { function removeCopyEvent() { Array.prototype.concat.call(document.querySelectorAll('*'), document) .forEach(function (ele) { ele.oncopy = undefined; ele.oncontextmenu = undefined; }); } function core() { global.addEventListener('contextmenu', removeCopyEvent); global.addEventListener('keydown', (e) => { if (e.ctrlKey || [17, 91, 93, 224].includes(e.keyCode)) { removeCopyEvent(); } }); // 这里不使用 hook,直接覆盖 addEventListener 也可以,但稍复杂 // 注入 CSS const style = ` body *:not(input):not(textarea) { -webkit-user-select: auto !important; -moz-user-select: auto !important; -ms-user-select: auto !important; user-select: auto !important; } `; const styleNode = document.createElement('style'); styleNode.type = 'text/css'; if (styleNode.styleSheet) { styleNode.styleSheet.cssText = style; } else { styleNode.appendChild(document.createTextNode(style)); } document.addEventListener('readystatechange', () => { if (['interactive', 'complete'].includes(document.readyState)) { setTimeout(() => { document.head.appendChild(styleNode); }, 2000); } }); } core(); })(window);