1 year ago

#353311

test-img

Patrick Visi

React browser inter-page communication with iframes

I know with iframes and postMessage/eventlisteners we can send messages between the parent and their child components.

So let's say I have 2 react applications (a main, and a frame). If inside the main I load the frame as an iframe, sending data is possible. However, what I would like to do is load the 2 app in 2 distinct pages, and then send the data like that. The url of these 2 pages is the same, except the port number (so, like: localhost:3000 and localhost:4000)

The 2 page can only know the other's url, and that's all

Now as I think about it, it brings up a lot of security question for sure, but I was still wondering if this could even be done?

reactjs

typescript

iframe

browser

communication

0 Answers

Your Answer

Accepted video resources