您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
修復 Microsoft To Do 欄位高度讓 textarea 高度自動符合內容
// ==UserScript== // @name Microsoft To Do 自動調整欄位高度 // @namespace http://tampermonkey.net/ // @version 1.1 // @description 修復 Microsoft To Do 欄位高度讓 textarea 高度自動符合內容 // @author shanlan(grok-code-fast-1) // @match https://to-do.office.com/tasks/* // @grant none // @license MIT // ==/UserScript== (function () { 'use strict'; const sel = 'textarea.ms-TextField-field'; const resize = t => { t.rows = 1; t.style.height = 'auto'; t.style.height = t.scrollHeight + 'px'; }; let isResizing = false; document.addEventListener('mousedown', () => (isResizing = true)); document.addEventListener('mouseup', () => { isResizing = false; document.querySelectorAll(sel).forEach(resize); }); document.addEventListener('input', e => { if (e.target.matches(sel)) resize(e.target); }, true); const ro = new ResizeObserver(entries => { if (isResizing) return; entries.forEach(entry => { if (entry.target.matches(sel)) resize(entry.target); }); }); const scan = node => { if (node.matches(sel)) { resize(node); ro.observe(node); } node.querySelectorAll(sel).forEach(n => { resize(n); ro.observe(n); }); }; const mo = new MutationObserver(muts => muts.forEach(m => m.addedNodes.forEach(scan))); mo.observe(document.body, { childList: true, subtree: true }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址