Apache index thumbnail bookmarklet

Tuesday 5th February 2008 11:46 PM

Just a quick bookmarklet for viewing typical apache index listings which contain linked image files, as thumbnails. This will go through and replace all links found to contain .gif, .jpg or .png extensions with a small 100x100 thumbnail of that image.

CAUTION: While they are thumbnails, this script needs to download the entire image to generate them. Be careful where/when you run this script as it may use a huge amount of bandwidth.

To use, copy the following code, and create a new bookmark with it as the "Location/URL". Visit the apache index you wish to "convert", and run the bookmarklet over the top of it.

javascript:(function(){ links=document.getElementsByTagName('a'); for(i=0;i<links.length;i++){if(links[i].getAttribute('href').match(/.jpg|.gif|.png/)){links[i].innerHTML='<img width="100" height="100" src="' + links[i].getAttribute('href') + '\">';}} })()

Comments on this article:


I love feedback and comments, be the first!

Add Comment:


Make a Comment

*Nb, all comments are moderated to prevent spam or inappropriate content.








netforge logo
netforge provides high quality and friendly website design services to business. We're Australian based and reliable... (find out more).