Extension:ImagePagePrintLink

The ImagePagePrintLink extension will add a ”print this image” link to the list of links in the top of a image descriptions page. Printing is done using JavaScript, and the link will be visible only if JavaScript is enabled and printing is supported. The link will only show up for local files, as most browsers will not allow JavaScript to print from other domains, and only if the file is a (seemingly) printable image.

This extension was written for Säsongsmat.nu. Please feel free to improve or change anything if you feel you could use it somewhere else.

To do

 * Find a better way to handle Google Chrome printing issues in ext.ImagePagePrintLink.core.js. Chrome will close the window immediately, and then try to print an empty page. Therefore, the image page is not closed again if JS detects Chrome. This is an ugly workaround, it would be nice to get rid of it.
 * Use something more accurate than canRender to check if media is image?