Simple Gmail userscript that restores old yellow icons and hover behaviour
| // ==UserScript== | |
| // @name Restore Yellow Stars | |
| // @namespace rebane2001 | |
| // @icon https://ssl.gstatic.com/ui/v1/icons/mail/gm3/1x/star_fill_googyellow500_20dp.png | |
| // @version 1.0.0 | |
| // | |
| // @match https://mail.google.com/mail/* | |
| // @grant none | |
| // @run-at document-idle | |
| // | |
| // @author rebane2001 | |
| // @description Simple Gmail userscript that restores old yellow icons and hover behaviour. | |
| // ==/UserScript== | |
| function tryPatch() { | |
| const mainStyle = document.querySelector(":root>head>style[data-href]"); | |
| if (!mainStyle) return setTimeout(tryPatch, 100); | |
| mainStyle.textContent = `tr:not(.aqw) { & > .xY > .T-KT, & > .xY > .pG { opacity: 0.7 }}` + mainStyle.textContent; | |
| mainStyle.textContent = mainStyle.textContent.replace(/double_arrow_baseline_p.00_(..dp.png\));?/g, (_, postfix) => "label_important_fill_googyellow500_" + postfix + `;&::after{ | |
| content: ''; | |
| background: url(https://ssl.gstatic.com/ui/v1/icons/mail/skinnable/infooverload_ltr_dark_2x.png) no-repeat -14px -9px; | |
| background-size: 42px 80px; | |
| width: 14px; | |
| height: 10px; | |
| position: absolute; | |
| translate: 4px 4px;}`); | |
| mainStyle.textContent = mainStyle.textContent.replace(/double_arrow_/g, "label_important_"); | |
| mainStyle.textContent = mainStyle.textContent.replace(/((?:label_important|star)_(?:fill_)?)(?:baseline_p.00|googblue.00)/g, (_, prefix) => prefix + "googyellow500"); | |
| } | |
| tryPatch(); |
评论
?
参与讨论