tampermonkey-pixelate-88x31s.js
· 506 B · JavaScript
Raw
// ==UserScript==
// @name Pixelate 88x31s
// @version 1.0.0
// @namespace https://chrisburnell.com/
// @author Chris Burnell
// @match *://*/*
// @run-at document-idle
// @grant none
// ==/UserScript==
[...document.querySelectorAll("img")].forEach((img) => {
const apply = () => {
if (img.naturalWidth === 88 && img.naturalHeight === 31) {
img.style.imageRendering = "pixelated";
}
};
img.complete ? apply() : img.addEventListener("load", apply);
});
| 1 | // ==UserScript== |
| 2 | // @name Pixelate 88x31s |
| 3 | // @version 1.0.0 |
| 4 | // @namespace https://chrisburnell.com/ |
| 5 | // @author Chris Burnell |
| 6 | // @match *://*/* |
| 7 | // @run-at document-idle |
| 8 | // @grant none |
| 9 | // ==/UserScript== |
| 10 | |
| 11 | [...document.querySelectorAll("img")].forEach((img) => { |
| 12 | const apply = () => { |
| 13 | if (img.naturalWidth === 88 && img.naturalHeight === 31) { |
| 14 | img.style.imageRendering = "pixelated"; |
| 15 | } |
| 16 | }; |
| 17 | img.complete ? apply() : img.addEventListener("load", apply); |
| 18 | }); |