Skip to content

Commit

Permalink
fix frame detection in the example
Browse files Browse the repository at this point in the history
  • Loading branch information
Aprillion committed Sep 15, 2023
1 parent 63acd09 commit 7dfb227
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion public/embed-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h3>Both search and initial questions, opening inline, expanding iframe height,
const iframes = [...document.querySelectorAll('iframe')]
window.addEventListener('message', function (event) {
if (event.data.type === 'aisafety.info__height') {
const iframe = iframes.find((iframe) => iframe.src === event.source.location.href)
const iframe = event.source.frameElement
if (iframe) {
iframe.style.height = event.data.height + 'px'
}
Expand Down

0 comments on commit 7dfb227

Please sign in to comment.