Skip to content

Instantly share code, notes, and snippets.

@slb235
Last active July 2, 2018 10:38
Show Gist options
  • Save slb235/42f66fc8818ae511e165559774a3e629 to your computer and use it in GitHub Desktop.
Save slb235/42f66fc8818ae511e165559774a3e629 to your computer and use it in GitHub Desktop.
var iframe = document.getElementById('abembed')
var match = document.URL.match(/result=([a-z0-9]+)/i)
if(match) {
iframe.src = 'https://en.actionbound.com/result/' + match[1] + '?t=wilderwander'
}
else {
console.error("cant find result in url", document.URL)
}
iFrameResize({heightCalculationMethod: 'bodyScroll'}, '#abembed')
window.addEventListener("message", function(e) {
if(e.data && e.data.url && e.data.action === 'open') {
window.location.href = e.data.url
}
}, false)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment