Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ export default {
// adding event listener to listen for messages from the iframe
window.addEventListener('message', this.eventListener)
},
beforeUnmount () {
// Clear the iframe src before unmount so PostHog's rrweb recorder can safely
// detach its event listeners. Without this, rrweb throws a SecurityError when
// calling contentWindow.removeEventListener on the cross-origin Node-RED iframe.
if (this.$refs.iframe) {
this.$refs.iframe.src = 'about:blank'
}
},
unmounted () {
window.removeEventListener('message', this.eventListener)
this.resetAssistant()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ export default {
return this.device.status
}
}
},
beforeUnmount () {
// Clear the iframe src before unmount so PostHog's rrweb recorder can safely
// detach its event listeners. Without this, rrweb throws a SecurityError when
// calling contentWindow.removeEventListener on the cross-origin Node-RED iframe.
if (this.$refs.iframe) {
this.$refs.iframe.src = 'about:blank'
}
}
}
</script>
Expand Down
Loading