您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
try to take over the world!
// ==UserScript== // @name lanhuapp // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author lbc // @email [email protected] // @match https://lanhuapp.com/web/ // @grant none // ==/UserScript== (function() { 'use strict'; window.curRemPanel = {} window.addRemPanel = function() { let a = window.dd.children[ window.dd.children.length - 1].cloneNode(true) let html = a.innerHTML.replace(/(\d*)px/g, function(match, a) { return `${a / 100}rem` }) a.innerHTML = html window.dd.appendChild(a) window.curRemPanel = a } window.onload = function() { setTimeout(() => { let aside = dd.parentElement.parentElement.parentElement var mutationObserver = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (mutation.attributeName === 'class') { console.log(aside.className) if (aside.className.indexOf('open') > -1) { setTimeout(() => { window.addRemPanel() }, 1000) } else { window.curRemPanel.remove() } } }); }); mutationObserver.observe(aside, { attributes: true, childList: true, }); }, 1000) } })();