Console: Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://a.com') does not match the recipient window's origin ('https://b.com')
window.postMessage() was sent with a targetOrigin that differs from the receiving window's real origin, so the message is dropped.
Failed to execute 'postMessage' on 'DOMWindow'The target origin provided does not match the recipient window's originFailed to execute 'postMessage' on 'Window'Unable to post message to Meaning
postMessage(data, targetOrigin) delivers only if the receiver's origin equals targetOrigin. Frames that redirect, use www/non-www, http vs https, or different ports will not match. Use the exact origin of the receiving frame (never "*" for sensitive data) and check event.origin on the receiving side.
Common causes
- Wrong scheme, host or port in
targetOrigin(http vs https, www vs non-www) - Iframe navigated or redirected to another origin
- Sending before the iframe has loaded
- Using
window.location.originfor a cross-site recipient - Popup closed or replaced
⚡ Quick fix
- Send to the receiver's exact origin (read it from the iframe
srcor a handshake message) - Wait for the iframe
loadevent before posting - Validate
event.originand the message format when receiving
Detailed fix by platform
JavaScript
- Sender:
iframe.contentWindow.postMessage({type:'init'}, 'https://widget.example.com');Receiver:addEventListener('message', e => { if (e.origin !== 'https://app.example.com') return; /* ... */ });
How to diagnose
- Origins — Sender target vs receiver actual origin?
- Redirects — Did the frame redirect?
- Timing — Frame loaded?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Aw, Snap! Chrome: Aw, Snap! Something went wrong while displaying this webpage. Error code: STATUS_ACCESS_VIOLATION / SIGILL / Out of Memory
- blocked a frame SecurityError: Blocked a frame with origin "x" from accessing a cross-origin frame.
- captive portal Browser: This network requires you to sign in — captive portal (hotel, airport, café Wi-Fi) blocking HTTPS sites
Most viewed in Browser
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 15 Oct 2026