# HG changeset patch # User nanaya # Date 1671790250 -32400 # Node ID afad36fddb643233f184551eb63832cbf361776f # Parent a35ddabefd9def5bc0e90ab9e7f3f5c074035d4e Add melonbooks unlazy diff -r a35ddabefd9d -r afad36fddb64 melonbooks-unlazy.user.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/melonbooks-unlazy.user.js Fri Dec 23 19:10:50 2022 +0900 @@ -0,0 +1,31 @@ +// ==UserScript== +// @name melonbooks unlazy +// @namespace https://nanaya.net +// @match https://www.melonbooks.co.jp/* +// @grant none +// @version 1.0.0 +// @author nanaya +// @description replace lazy loaded images with just images +// @downloadURL https://hg.nanaya.net/ec-userscripts/raw-file/tip/melonbooks-unlazy.user.js +// ==/UserScript== + +'use strict' + +function unlazy () { + for (const img of document.querySelectorAll('.lazyload')) { + const src = img.dataset.src + + if (src != null) { + img.src = src + img.classList.remove('lazyload') + img.classList.add('unlazied') + delete img.dataset.src + } + } +} + +if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', unlazy) +} else { + unlazy() +}