annotate melonbooks-unlazy.user.js @ 96:368035f2213b

Use builtin framework for document ready
author nanaya <me@nanaya.net>
date Fri, 23 Dec 2022 19:14:04 +0900
parents afad36fddb64
children c8f9350c5307
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
95
afad36fddb64 Add melonbooks unlazy
nanaya <me@nanaya.net>
parents:
diff changeset
1 // ==UserScript==
afad36fddb64 Add melonbooks unlazy
nanaya <me@nanaya.net>
parents:
diff changeset
2 // @name melonbooks unlazy
afad36fddb64 Add melonbooks unlazy
nanaya <me@nanaya.net>
parents:
diff changeset
3 // @namespace https://nanaya.net
afad36fddb64 Add melonbooks unlazy
nanaya <me@nanaya.net>
parents:
diff changeset
4 // @match https://www.melonbooks.co.jp/*
afad36fddb64 Add melonbooks unlazy
nanaya <me@nanaya.net>
parents:
diff changeset
5 // @grant none
96
368035f2213b Use builtin framework for document ready
nanaya <me@nanaya.net>
parents: 95
diff changeset
6 // @run-at document-end
368035f2213b Use builtin framework for document ready
nanaya <me@nanaya.net>
parents: 95
diff changeset
7 // @version 1.0.1
95
afad36fddb64 Add melonbooks unlazy
nanaya <me@nanaya.net>
parents:
diff changeset
8 // @author nanaya
afad36fddb64 Add melonbooks unlazy
nanaya <me@nanaya.net>
parents:
diff changeset
9 // @description replace lazy loaded images with just images
afad36fddb64 Add melonbooks unlazy
nanaya <me@nanaya.net>
parents:
diff changeset
10 // @downloadURL https://hg.nanaya.net/ec-userscripts/raw-file/tip/melonbooks-unlazy.user.js
afad36fddb64 Add melonbooks unlazy
nanaya <me@nanaya.net>
parents:
diff changeset
11 // ==/UserScript==
afad36fddb64 Add melonbooks unlazy
nanaya <me@nanaya.net>
parents:
diff changeset
12
afad36fddb64 Add melonbooks unlazy
nanaya <me@nanaya.net>
parents:
diff changeset
13 'use strict'
afad36fddb64 Add melonbooks unlazy
nanaya <me@nanaya.net>
parents:
diff changeset
14
96
368035f2213b Use builtin framework for document ready
nanaya <me@nanaya.net>
parents: 95
diff changeset
15 for (const img of document.querySelectorAll('.lazyload')) {
368035f2213b Use builtin framework for document ready
nanaya <me@nanaya.net>
parents: 95
diff changeset
16 const src = img.dataset.src
95
afad36fddb64 Add melonbooks unlazy
nanaya <me@nanaya.net>
parents:
diff changeset
17
96
368035f2213b Use builtin framework for document ready
nanaya <me@nanaya.net>
parents: 95
diff changeset
18 if (src != null) {
368035f2213b Use builtin framework for document ready
nanaya <me@nanaya.net>
parents: 95
diff changeset
19 img.src = src
368035f2213b Use builtin framework for document ready
nanaya <me@nanaya.net>
parents: 95
diff changeset
20 img.classList.remove('lazyload')
368035f2213b Use builtin framework for document ready
nanaya <me@nanaya.net>
parents: 95
diff changeset
21 img.classList.add('unlazied')
368035f2213b Use builtin framework for document ready
nanaya <me@nanaya.net>
parents: 95
diff changeset
22 delete img.dataset.src
95
afad36fddb64 Add melonbooks unlazy
nanaya <me@nanaya.net>
parents:
diff changeset
23 }
afad36fddb64 Add melonbooks unlazy
nanaya <me@nanaya.net>
parents:
diff changeset
24 }