Sprache
Lieferland
["getShopData", "getVariations", "getItems", "addItemsToBasket", "variationInfo", "reloadPage"].forEach(function(eventName) { if (eventName == "variationInfo") { window.addEventListener("message", function(e) { if (e.data.action == eventName) { fetch(location.origin + "/test/" + e.data.variation.url + "_" + e.data.variation.item.id + "_" + e.data.variation.id) .then(function(res) { res.text().then(function(text) { document.getElementById("iframe-livebundler").contentWindow.postMessage( { action: "variationInfo", res: text }, "*" ); }); }); } }); } else if (eventName == "reloadPage") { window.addEventListener("message", function(e) { if (e.data.action == eventName) { window.location.reload(); } }); } else { window.addEventListener("message", function(e) { if (e.data.action == eventName) { fetch(location.origin + "/livebundler/" + eventName + e.data.params).then(function(res) { res.json().then(function(json) { document.getElementById("iframe-livebundler").contentWindow.postMessage({ action: eventName, res: json }, "*"); }); }); } }); } });