Lesson 0008 · ~8 minutes
One skill: given a product need, name the tool and who can talk. Use the rules sheet.
You can say this in a review: “Is there another WindowProxy? Who must hear? What do I check? When do I close?”
postMessage.
targetOrigin
now,
event.origin
then, then the shape of
event.data. Port: you hold the port.
event.origin is empty.
port2.
Wait for ready before you send.
Answer as you would in a review.
A filter control is a React component in this page. Same window. You need to set the query.
Checkout is one iframe. Ads is another. Only checkout may see the cart.
You send a session token to a popup with targetOrigin "*". The popup goes to evil.example.
You set iframe.src and send init in the same tick.
A widget sends { paid: true }. event.origin is the widget origin you expect.
targetOrigin. Check
event.origin. Then check the data shape.
The rules sheet, then HTML §9.3.2.1.