Sha256: 0b7d0d91db06de2e0be2f090a982cedb0360148c1c293e4bc4aa96892e414ba3
Contents?: true
Size: 764 Bytes
Versions: 4
Compression:
Stored size: 764 Bytes
Contents
document.addEventListener("DOMContentLoaded", function() { var redirectTargetElement = document.getElementById("redirection-target"); var targetInfo = JSON.parse(redirectTargetElement.dataset.target) if (window.top == window.self) { // If the current window is the 'parent', change the URL by setting location.href window.top.location.href = targetInfo.url; } else { // If the current window is the 'child', change the parent's URL with postMessage normalizedLink = document.createElement('a'); normalizedLink.href = targetInfo.url; data = JSON.stringify({ message: 'SpiffyStores.API.remoteRedirect', data: { location: normalizedLink.href } }); window.parent.postMessage(data, targetInfo.myspiffyUrl); } });
Version data entries
4 entries across 4 versions & 1 rubygems