-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathview_image.min.js
1 lines (1 loc) · 1.44 KB
/
view_image.min.js
1
javascript:void%20function(){function%20e(e){const%20t=e.getBoundingClientRect();return%20t.top%3E=0%26%26t.left%3E=0%26%26t.bottom%3C=(window.innerHeight||document.documentElement.clientHeight)%26%26t.right%3C=(window.innerWidth||document.documentElement.clientWidth)}function%20t(e){var%20t=document.createElement(%22template%22);return%20e=e.trim(),t.innerHTML=e,t.content.firstChild}function%20n(t){var%20o=t.iterateNext();if(console.log([o.src,o]),!o)return!1;if(e(o)){if(o.src.includes(%22data:image%22)){const%20r=o.src.substring(5,o.src.indexOf(%22;%22)),s=atob(o.src.substring(o.src.indexOf(%22,%22)+1)),c=[];for(offset=0;offset%3Cs.length;offset+=1024){const%20d=s.slice(offset,offset+1024),l=new%20Array(d.length);for(i=0;i%3Cd.length;i++)l[i]=d.charCodeAt(i);const%20u=new%20Uint8Array(l);c.push(u)}const%20a=new%20Blob(c,{type:r}),f=URL.createObjectURL(a);window.open(f,%22_blank%22)}else%20window.open(o.src);return!0}n(t)}var%20o=%221.6.1%22;%22undefined%22==typeof%20window.isElementVisible%26%26(window.isElementVisible=e),document.querySelector(%22%23viewimage_version%22)||document.body.appendChild(t('%3Ca%20id=%22viewimage_version%22%20href=%22https://d3vr.github.io/viewimage/%22%20style=%22position:fixed;%20z-index:999;%20top:%200;%20right:0;%22%3E%3Cimg%20src=%22https://d3vr.me/viewimage/version.php%3Fv='+o+'%22%20height=%2230%22%3E%3C/a%3E'));var%20r=document.evaluate(%22//div[%40data-query]//img%22,document,null,XPathResult.ANY_TYPE,null);n(r)}();