您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
A firefox addon that adds a horizontal translucent bar that follows the cursor. A reading aid for pages with wiiiiiiide paragraphs.
当前为
// ==UserScript== // @name Reading Ruler // @namespace https://old.reddit.com/r/SomebodyMakeThis/comments/9huwbw/smt_a_firefox_addon_that_adds_a_horizontal/ // @version 0.1 // @description A firefox addon that adds a horizontal translucent bar that follows the cursor. A reading aid for pages with wiiiiiiide paragraphs. // @author /r/defproc // @match */* // @grant none // ==/UserScript== (function() { 'use strict'; var bar = document.createElement("div"); var styles = { left: 0, right: 0, height: "1.25em", backgroundColor: "#00ff0012", position: "absolute", transform: "translateY(-50%)", display: "none", pointerEvents: "none", transition: "120ms height" }; Object.keys(styles).forEach(function(k){ bar.style[k] = styles[k] }); document.body.addEventListener("mousemove", function(ev){ bar.style.top = ev.clientY + "px"; if(visible){ var over = document.elementFromPoint(ev.clientX, ev.clientY); bar.style.height = window.getComputedStyle(over).getPropertyValue("line-height"); } }); var visible = false; var toggle = function(){ visible = !visible; document.body.appendChild(bar); bar.style.display = visible ? "block" : "none"; }; window.addEventListener("keypress", function(ev){ if(ev.ctrlKey && ev.altKey) toggle(); }); })();