Skip to content

Instantly share code, notes, and snippets.

@jkimbo
Created July 1, 2022 14:50
<iframe style="width: 100%;" id="fronted-payments-container" src="https://app.fronted.rent/embed/v1/widget?partnerId=..." scrolling="no" />
<script>
(function() {
var frame = document.getElementById("fronted-payments-container");
frame.addEventListener("load", function() {
frame.contentWindow.postMessage("measure-height", "https://app.fronted.rent");
});
window.addEventListener("message", function(event) {
if (event.origin !== "https://app.fronted.rent") return;
var data = JSON.parse(event.data);
if (data.message === "measure-height") {
frame.style.height = data.height + "px";
}
});
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment