您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Hide annoyingly long names.
// ==UserScript== // @name Shorten Names for Proving for Fun // @namespace do-proof-in-tum-de-addons // @match https://do.proof.in.tum.de/* // @grant none // @version 0.1 // @author Max Lang // @license 0BSD // @description Hide annoyingly long names. // ==/UserScript== (function() { const rules = [ [".navbar-text strong", /(\S+)/d], [".scoretnb, .scoretn", /(\S+)/d], [".container div", /Submitted by (\S+) @/d] ]; for (const [selector, pattern] of rules) { for (const el of document.querySelectorAll(selector)) { for (const child of [...el.childNodes]) { if (child.nodeType != 3) continue; const match = child.textContent.match(pattern); if (match === null) continue; const span = document.createElement("span"); const spanText = child.textContent.substring(...match.indices[1]); span.textContent = spanText; span.title = spanText; span.style.display = "inline-block"; span.style.width = "10em"; span.style.overflow = "hidden"; span.style.textOverflow = "ellipsis"; span.style.verticalAlign = "bottom"; child.replaceWith( child.textContent.substring(0, match.indices[1][0]), span, child.textContent.substring(match.indices[1][1]) ); } } } })();