index of pages
|
|
Could someone make a script that converts image links into pictures only on index of pages? |
|
|
Array.prototype.haskey = function(key) {
for (var x=0; x<this.length; x++) {
if (this[x] === key) {
return true;
}
}
return false;
}
var allowed = ["jpg","jpeg","gif","png","bmp"];
var links = document.getElementsByTagName("a");
for (var i=0; i<links.length; i++) {
if (allowed.haskey(links[i].href.toLowerCase().split(".").pop())) {
var image = document.createElement("img");
image.src = links[i].href;
links[i].parentNode.replaceChild(links[i], image);
}
}
This is just on-the-fly, you'll still have to look when a page is indexing and stuff.
|
