Skip to content

Instantly share code, notes, and snippets.

@timfjord
Created October 7, 2012 10:30
Show Gist options
  • Save timfjord/3847801 to your computer and use it in GitHub Desktop.
Save timfjord/3847801 to your computer and use it in GitHub Desktop.
Mybeautystore Photo Grabber
// ==UserScript==
// @name Mybeautystore Photo Grabber
// @namespace MybeautystorePhotoGrabber
// @author Tima Maslychenko
// @description Script that show big picture on product page
// @match http://www.mybeautystore.de/*/*.html
// @version 0.1
// ==/UserScript==
// a function that loads jQuery and calls a callback function when jQuery has finished loading
function addJQuery(callback) {
var script = document.createElement("script");
script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js");
script.addEventListener('load', function() {
var script = document.createElement("script");
script.textContent = "(" + callback.toString() + ")();";
document.body.appendChild(script);
}, false);
document.body.appendChild(script);
}
function main() {
if ($('#zoom-big img').length > 0) {
var link = '<a href="' + $('#zoom-big img').attr('src') + '" target="_blank">Open big picture</a>';
$(link).insertAfter('#productinfoimages');
}
}
// load jQuery and execute the main function
addJQuery(main);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment