您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
自动解除 textarea 上的复制、粘贴、拖拽和文本选择限制
当前为
// ==UserScript== // @name 智云学堂插件 // @namespace http://tampermonkey.net/ // @version 0.0.4 // @description 自动解除 textarea 上的复制、粘贴、拖拽和文本选择限制 // @author You // @match https://www.e100soft.com/aikc/*.asp // @icon https://www.google.com/s2/favicons?sz=64&domain=e100soft.com // @grant none // @license MIT // @run-at document-idle // ==/UserScript== (function() { 'use strict'; function removeEventRestrictions() { const textareas = document.querySelectorAll('textarea'); if (textareas.length > 0) { textareas.forEach(textarea => { const newTextarea = textarea.cloneNode(true); textarea.parentNode.replaceChild(newTextarea, textarea); console.log('已成功解除对 textarea 的所有限制'); // 添加监听内容变化的功能 addContentChangeListener(newTextarea); }); observer.disconnect(); } } // 新增:监听 textarea 内容变化并更新 time9 function addContentChangeListener(textarea) { textarea.addEventListener('input', function() { const textLength = textarea.value.length; window.time9 = textLength; console.log(`time9 已更新为: ${window.time9}`); }); } const observer = new MutationObserver((mutations, obs) => { removeEventRestrictions(); }); observer.observe(document.body, { childList: true, subtree: true }); removeEventRestrictions(); console.log('脚本运行中...'); })();