Pre-load Image Links

By JoeSimmons Last update Oct 29, 2008 — Installed 651 times.

There are 12 previous versions of this script.

// ==UserScript==
// @name           Pre-load Image Links
// @namespace      http://userscripts.org/users/23652
// @description    Pre-loads links to images for a faster image load when clicked
// @include        *
// @exclude        about:*
// @exclude        chrome:*
// @exclude        http://*.google.com/*
// @copyright      JoeSimmons
// ==/UserScript==

var i, dl=document.evaluate("//a",document,null,6,null), dll=dl.snapshotLength, thref;

for(i=0; i<dll; i++) {
thref = dl.snapshotItem(i).href;
if(/\.(jpe?g|gif|png|bmp|tiff)$/i.test(thref) && !/\?.+\=/.test(thref) &&/^(ftp|http|https)/i.test(thref)) {
new Image().src = thref;
}

}