Mercurial > ec-userscripts
comparison soranews-image.user.js @ 109:ef21ef445fc6
Cleanups
- wrap everything in function and call them last
- fix namespace and update url
author | nanaya <me@nanaya.net> |
---|---|
date | Sun, 15 Jan 2023 23:33:41 +0900 |
parents | 2c4470b73ad9 |
children | d9dc190bccaf |
comparison
equal
deleted
inserted
replaced
108:2c4470b73ad9 | 109:ef21ef445fc6 |
---|---|
1 // ==UserScript== | 1 // ==UserScript== |
2 // @name Soranews image fix | 2 // @name Soranews image fix |
3 // @namespace https://myconan.net | 3 // @namespace https://nanaya.net |
4 // @version 1.0.3 | 4 // @version 1.0.3 |
5 // @description Soranews lazy load image fix | 5 // @description Soranews lazy load image fix |
6 // @author nanaya | 6 // @author nanaya |
7 // @match https://soranews24.com/* | 7 // @match https://soranews24.com/* |
8 // @grant none | 8 // @grant none |
9 // @downloadURL https://hg.myconan.net/ec-userscripts/raw-file/tip/soranews-image.user.js | 9 // @downloadURL https://hg.nanaya.net/ec-userscripts/raw-file/tip/soranews-image.user.js |
10 // ==/UserScript== | 10 // ==/UserScript== |
11 | 11 |
12 (function () { | 12 'use strict'; |
13 'use strict'; | |
14 | 13 |
14 function unlazy () { | |
15 const fix = function (image) { | 15 const fix = function (image) { |
16 // basic sanity check | 16 // basic sanity check |
17 if (!image.classList.contains('lazy')) { | 17 if (!image.classList.contains('lazy')) { |
18 return; | 18 return; |
19 } | 19 } |
50 | 50 |
51 // start the observer | 51 // start the observer |
52 observer.observe(document, { childList: true, subtree: true }); | 52 observer.observe(document, { childList: true, subtree: true }); |
53 // initial run on existing document | 53 // initial run on existing document |
54 run(); | 54 run(); |
55 }).call(); | 55 } |
56 | |
57 unlazy(); |