Last active
August 29, 2015 14:08
-
-
Save tpai/eaaa39a9f078239bafdf to your computer and use it in GitHub Desktop.
eyny-image-packer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (location.hostname.search("eyny.com") != -1) { | |
var data = ""; | |
var img_arr = new Array; | |
img_arr = document.getElementsByClassName("pcb")[0].getElementsByTagName("img"); | |
var view = prompt("[1]HTML(網頁)[2]Links(連結)", ""); | |
for (var i = 0; i < img_arr.length; i++) { | |
if (view == 1) { | |
data += "<img src='" + img_arr[i].getAttribute("src") + "' width='" + img_arr[i].getAttribute("width") + "' /><br />\n" | |
} else if (view == 2) { | |
data += img_arr[i].getAttribute("src") + "\r\n" | |
} | |
} | |
if (view == 1) mimeType = "text/html"; | |
else if (view == 2) mimeType = "text/plain"; | |
window.location.href = "data:" + mimeType + ";charset=utf-8," + encodeURIComponent(data) | |
} else { | |
alert("eyny.com") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:if(location.hostname.search("eyny.com")!=-1){var data="";var img_arr=new Array;img_arr=document.getElementsByClassName("pcb")[0].getElementsByTagName("img");var view=prompt("[1]HTML(網頁)[2]Links(連結)","");for(var i=0;i<img_arr.length;i++){if(view==1){data+="<img src='"+img_arr[i].getAttribute("src")+"' width='"+img_arr[i].getAttribute("width")+"' /><br />\n"}else if(view==2){data+=img_arr[i].getAttribute("src")+"\r\n"}}if(view==1)mimeType="text/html";else if(view==2)mimeType="text/plain";window.location.href="data:"+mimeType+";charset=utf-8,"+encodeURIComponent(data)}else{alert("eyny.com")} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment