I have a widget script (widget.js) deployed on an AWS S3 bucket. This script creates an iframe with its src set to http://localhost:5000.
I embedded widget.js using script tag in my web app. Once the iframe is loaded I am sending message postMessage to http://localhost:5000
Problem:
The postMessage works as expected in normal browsing mode but fails in incognito mode. I suspect this might be due to stricter privacy settings or cookies issues in incognito mode, but I haven’t been able to pinpoint the exact cause.
Environment:
- Browser: Chrome (latest version)
- Operating System: macOS Ventura
Solutions Tried:
- Ensuring correct target origin in postMessage.
- Checking browser console for errors (none found).
- Disabling browser extensions.
- Simplified the code to isolate the problem.
Expectation:
- The post message should work even in incognito mode
Rishi Anand is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.