您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Loads badass Luffy as a placeholder if original image doesn't load (under recent anime)
当前为
// ==UserScript== // @name Masterani Placeholder // @version 0.1 // @description Loads badass Luffy as a placeholder if original image doesn't load (under recent anime) // @license WTFPL v2 // @include http://www.masterani.me/ // @namespace https://greasyfork.org/users/5141 // ==/UserScript== function ImageLoad(imgId) { if (document.getElementById(imgId).naturalWidth < 2) // note: if image doesn't load naturalWidth == 1 return false; return true; } window.onload = function SetImgId() { var imgArray = document.getElementsByClassName("lazy"); for (var i = 0; i < imgArray.length; i++) { imgArray[i].id = "img" + i; if (!ImageLoad(imgArray[i].id)) imgArray[i].src = "http://oi62.tinypic.com/2zoer7s.jpg"; } }