-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetIMG_noJquery.min.js
1 lines (1 loc) · 2.53 KB
/
getIMG_noJquery.min.js
1
javascript:(function(){window.$=document.querySelectorAll.bind(document);function a(b){if(document.readyState!="loading"){b()}else{document.addEventListener("DOMContentLoaded",b)}}setTimeout(function(){$(document).ready(function(){$("#IMGlist").parentNode.removeChild($("#IMGlist"));$("body").innerHTML='<div id="IMGlist" style="display:none;position:fixed;top:0;left:0;z-index:99999;background:#fff;padding:5px;"><div style="position:absolute;top: 0;right:0;color:red;" onclick="$(this).parent().remove();">X</div></div>'+$("body").innerHTML;$("body *").forEach(function(f,e){f.setAttribute("style",e.getAttribute("style")+"cursor:crosshair!important;")});var d=null;$("*").addEventListener("mouseenter",function(){d=this});var c=function(f){f.preventDefault()};var b=function(){$("body *").removeEventListener("click",c);$("body").removeEventListener("click",b);$("body *").forEach(function(g,f){g.setAttribute("style",f.getAttribute("style")+"cursor:auto!important;")});$("#IMGlist div").forEach(function(g,f){g.setAttribute("style",f.getAttribute("style")+"cursor:pointer!important;")});var e=false;if($(d).tagName==="IMG"){$("#IMGlist").setAttribute("style",$("#IMGlist").getAttribute("style")+"display:block!important;");$("#IMGlist").innerHTML('Found:<br /><div style="overflow:hidden;width:100px;height:100px;float:left;clear:both;"><img style="max-width:200%;" src="'+$(d).attr("SRC")+'"/></div><div style="height:100px;float:left;">URL:<input style="max-height:25px" value="'+$(d).attr("SRC")+'" /></div><br />');e=true}else{if($(d).parentNode().querySelector("IMG").length){$("#IMGlist").show().append("Found:<br />");$(d).parent().find("IMG").each(function(){$("#IMGlist").append('<div style="overflow:hidden;width:25px;height:25px;float:left;clear:both;"><img style="max-width:200%;" src="'+$(this).attr("SRC")+'"/></div><div style="height:15x;float:left;">URL:<input style="max-height:25px" value="'+$(this).attr("SRC")+'" /></div><br />')});e=true}else{$(d).parent().parent().find("*").each(function(){if($(this).css("background-image")!="none"){bgIMG=$(this).css("background-image");$("#IMGlist").show().append('<div style="overflow:hidden;width:25px;height:25px;float:left;clear:both;"><img style="max-width:200%;" src="'+bgIMG.substring(5,bgIMG.length-2)+'"/></div><div style="height:25px;float:left;">URL:<input style="max-height:25px" value="'+bgIMG.substring(5,bgIMG.length-2)+'" /></div><br />');e=true}});if(e){$("#IMGlist").prepend("Found:<br />")}}if(e==false){alert("Image was not found. sorry :(")}}};$("body *").bind("click",c);$("body").bind("click",b)})},250)})();