您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
在 Web 页面中直接显示图片,禁止延迟加载,一次性加载所有图片
当前为
// ==UserScript== // @name 禁止 Web 延迟加载图片(一次性加载) // @name:en Disable web lazy loading images (one-time loading) // @description 在 Web 页面中直接显示图片,禁止延迟加载,一次性加载所有图片 // @description:en Display images directly on the web page, disable lazy loading, load all images at once. // @version 0.6.2 // @author DUN // @match *://*/* // @run-at document-end // @namespace http://greasyfork.icu/users/662094 // ==/UserScript== (function() { function addSrcToImage(originalImg, newImg) { var src = originalImg.getAttribute('data-src'); if (src) { newImg.setAttribute('src', src); } } function processLazyImages() { var lazyImages = document.querySelectorAll('img[data-src]'); lazyImages.forEach(function(originalImg) { var newImg = new Image(); addSrcToImage(originalImg, newImg); // 复制原始图片的其他属性到新的图片元素 for (var i = 0; i < originalImg.attributes.length; i++) { var attr = originalImg.attributes[i]; if (attr.name !== 'src' && attr.name !== 'data-src') { newImg.setAttribute(attr.name, attr.value); } } // 替换原始图片 originalImg.parentNode.replaceChild(newImg, originalImg); }); } processLazyImages(); })();