// ==UserScript==
// @name          	Reload Broken Images
// @author	  	abc@home
// @description   	Reload broken images in webpage and hide red-x if reload also fail
// @description0x0804  	刷新未能打开的图案，刷新后还是未能打开的便把红叉隐藏
// @include       	*
// @injectframes  	1
// ==/UserScript==

(function(){
	var x=document.images;
	for(i=0; i<=x.length-1; i++){
		if(x[i].readyState=='uninitialized'){
			x[i].style.visibility='hidden';
			x[i].onreadystatechange=function(){
				var y=event.srcElement;
				if(y.readyState=='complete'){
					y.style.visibility='visible';
					y.onreadystatechange=null;
				}
			}
			x[i].src=x[i].src;
		}
	}
})();
