Skip to content

Instantly share code, notes, and snippets.

@motiejus
Last active May 2, 2016 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save motiejus/063233890c207c0e9dce to your computer and use it in GitHub Desktop.
Save motiejus/063233890c207c0e9dce to your computer and use it in GitHub Desktop.
Preload full images on aruodas.lt detail page
// ==UserScript==
// @name preload images on aruodas.lt
// @namespace motiejus
// @description Preload images on detail pages in aruodas.lt
// @include http*://*.aruodas.lt/*
// @version 4
// @grant none
// @downloadURL https://gist.github.com/raw/063233890c207c0e9dce/aruodas.user.js
//
// ==/UserScript==
if (window.top != window.self) //-- Don't run on frames or iframes.
return;
$.fn.fancybox.defaults.changeSpeed = 0;
var num_iframes = 0;
jQuery("a.link-obj-thumb[href]").each(function() {
var iframe = '<iframe class="GM_hiddenIFrame" src="'+this.href+'"></iframe>';
$("body").append(iframe);
num_iframes++;
});
console.log("[aruodas.lt preloader] Loaded " + num_iframes + " iframes");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment