您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
change font size of GEE
当前为
// ==UserScript== // @name GEE Font Size // @namespace http://tampermonkey.net/ // @version 0.1 // @description change font size of GEE // @author You // @match https://code.earthengine.google.com/ // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant GM_addStyle // ==/UserScript== (function() { 'use strict'; let buttonBox = document.querySelector('.editor-panel .header div') let createButton = (title, innerHTML, func) => { let button = document.createElement('button') button.classList.add('goog-button') button.setAttribute('title', title) button.innerHTML = innerHTML button.onclick = func buttonBox.insertBefore(button, buttonBox.firstChild) } let changeFontSize = (operate) => { const minSize = 13 const maxSize = 60 return () => { let box = document.querySelector('.ace_editor') let size = Number(getComputedStyle(box).fontSize.replace('px', '')) console.log(size) size = eval(operate) if (size >= minSize && size <= maxSize) { console.log(`${size}px !important`) GM_addStyle(` .ace_editor { font-size: ${size}px !important; } `) } } } createButton('Decrease Font Size', '-', changeFontSize('size - 1')) createButton('Increase Font Size', '+', changeFontSize('size + 1')) })();