Last active
March 27, 2023 14:32
-
-
Save atomgiant/153cf5cd7c51b711e51f8e92286f88bf to your computer and use it in GitHub Desktop.
Shopify embedded app fullpage redirect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type='text/javascript'> | |
if (window.top == window.self) { | |
window.top.location.href = "<%= url %>"; | |
} else { | |
message = JSON.stringify({ | |
message: "Shopify.API.remoteRedirect", | |
data: { location: "<%= url %>" } | |
}); | |
window.parent.postMessage(message, "https://<%= shopify_domain %>"); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment