Send message from js to trame is Ok, but when I try to send message from trame to js, it didn't work.

Maybe there's a problem in the example js-trame

it seems that postMessage in iframe should like that
window.parent.postMessage(message)
so at the outside, I can receive message like this:
window.addEventListener
or there is another way to solve this problems?