
Show HN: Windtalk – Let windows/iframes invoke each other's functions or objects - shihn
https://pshihn.github.io/windtalk
======
gitgud
Wow cool. Just wondering though, how is this even possible? I thought Iframes
were sandboxed from each other for security

~~~
shihn
I'm using a proxy object that ends up sending messages to the iframe behind
the scene. So, from your perspective you're just accessing the object/function
as if it is was in your window's context

See: [https://developer.mozilla.org/en-
US/docs/Web/API/Window/post...](https://developer.mozilla.org/en-
US/docs/Web/API/Window/postMessage) and [https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Proxy)

------
oscarsowilde
Neat

