K-Meleon

KMeleonWiki > Resources > MacroLibrary > MacroLibrary2 > Reload Image

Submitted by: kko



Notes:

This macro is designed for K-Meleon 0.9. It provides an additional context menu option to reload an image. Such a functionality is valuable, when images are broken due to small bandwidth or due to HTTP pipelining. In addition to that, it empowers you to load images manually, while image loading is disabled in general.


In Macros:

ReloadImage{
$tmp=true; getpref(INT,$images)==2 ? &ImgToggle : $tmp=false;
$tmq=true; getpref(BOOL,"dom.disable_image_src_set") ? togglepref(BOOL,"dom.disable_image_src_set") : $tmq=false;
$macro="ReloadImg"; &JSEnable;
$tmp ? &ImgToggle : "";
$tmq ? togglepref(BOOL,"dom.disable_image_src_set") : "";
}
ReloadImg{
open("javascript:function chkImg(e){var t='".$ImageURL."',i=e.document.images;for(var j=0;j<i.length;j++)if(i[j].src==t){i[j].src="";i[j].src=t;}}function chkFrm(e){var f=e.frames;for(var j=0;j<f.length;j++)chkFrm(f[j]);chkImg(e);}void(chkFrm(top));");
}


In Menus:

Image{
 %ifplugin macros
 macros(ZoomInImage, Zoom In Image)
 macros(ZoomOutImage, Zoom Out Image)
 -
 %endif
 &View Image = ID_VIEW_IMAGE
 Copy Image = ID_COPY_IMAGE_CONTENT
 Cop&y Image URL = ID_COPY_IMAGE_LOCATION
 %ifplugin macros
 macros(SaveImage, Save Image As...)
 macros(EmailImageURL, Send Image...)
 macros(ReloadImage, Reload Image)
 macros(ImageCache, View Image Info)
 macros(ImageInfo, Image Properties...)
 %else
 Save &Image As... = ID_SAVE_IMAGE_AS
 %endif
}


Comments & Questions

K-Meleon

(c) 2000-2010 kmeleonbrowser.org. All rights reserved.
design by splif.