Mercurial > ec-userscripts
comparison pixiv-fanbox-unlazy.user.js @ 101:e21710f5dd7b
Also run on its own node
author | nanaya <me@nanaya.net> |
---|---|
date | Sat, 24 Dec 2022 21:31:42 +0900 |
parents | 74c33632c353 |
children | 93e21738b588 |
comparison
equal
deleted
inserted
replaced
100:74c33632c353 | 101:e21710f5dd7b |
---|---|
1 // ==UserScript== | 1 // ==UserScript== |
2 // @name pixiv fanbox no lazy loading image | 2 // @name pixiv fanbox no lazy loading image |
3 // @namespace https://myconan.net | 3 // @namespace https://myconan.net |
4 // @version 2.1.0 | 4 // @version 2.1.1 |
5 // @description Lazy loading is bad for environment. Disable it. | 5 // @description Lazy loading is bad for environment. Disable it. |
6 // @author nanaya | 6 // @author nanaya |
7 // @match https://*.fanbox.cc/* | 7 // @match https://*.fanbox.cc/* |
8 // @grant none | 8 // @grant none |
9 // @run-at document-start | 9 // @run-at document-start |
41 | 41 |
42 function onMutate (mutations) { | 42 function onMutate (mutations) { |
43 for (const mutation of mutations) { | 43 for (const mutation of mutations) { |
44 for (const node of mutation.addedNodes) { | 44 for (const node of mutation.addedNodes) { |
45 if (node instanceof window.HTMLElement) { | 45 if (node instanceof window.HTMLElement) { |
46 fix(node) | |
46 for (const link of node.querySelectorAll(`[href^="${imageUrlPrefix}"]`)) { | 47 for (const link of node.querySelectorAll(`[href^="${imageUrlPrefix}"]`)) { |
47 fix(link) | 48 fix(link) |
48 } | 49 } |
49 } | 50 } |
50 } | 51 } |