I have an embedded looker iframe which contains a look. I need to update the UI in the parent window after a look is reloaded (update filters and then re-run). But it looks like posting messages to the looker iframe doesn’t trigger and message back to the parent window. Is this the correct behavior? Is there a workaround for this issue?
Here a pseudo code
// first register the listener
window.addEventListener('message', (e) => {
// I see the look iframe messages when the iframe is first loaded
// *** NOTHING is triggered after I update and reload the look
console.log(e)
})
function reload(iframe) {
// update filters
let updateJSON = JSON.stringify({
type: 'look:filters:update',
filters: { .... },
})
iframe.contentWindow.postMessage(updateJSON, '...')
// reload look
let runJSON = JSON.stringify({ type: 'look:run' })
iframe.contentWindow.postMessage(runJSON, '...')
// iframe is updated successfully, but parent window doesn't get any "message"
}
// lookerIframe is the looker iframe
reload(lookerIframe)