comparison melonbooks-unlazy.user.js @ 98:3e5f1fa9ed52

Skip redundant class check and add dataset check instead
author nanaya <me@nanaya.net>
date Fri, 23 Dec 2022 19:58:14 +0900
parents c8f9350c5307
children b44d5cb661c5
comparison
equal deleted inserted replaced
97:c8f9350c5307 98:3e5f1fa9ed52
11 // ==/UserScript== 11 // ==/UserScript==
12 12
13 'use strict' 13 'use strict'
14 14
15 function fix (image) { 15 function fix (image) {
16 if (!image.classList.contains('lazyload')) return 16 const src = image.dataset.src
17
18 if (src == null) return
17 19
18 image.classList.remove('lazyload') 20 image.classList.remove('lazyload')
19 image.src = image.dataset.src 21 image.src = image.dataset.src
20 delete image.dataset.src 22 delete image.dataset.src
21 } 23 }