Window A is any website. The user runs a bookmarklet in this window which downloads a script from my domain. Window B is on my website and has the same domain as the script. What is the best way to send a message from window A to window B when the user runs the bookmarklet?
I was able to get this working by using window.postMessage
to communate to a hidden iframe on my domain which used the localstorage api to forward the message to window B. However, I want to know if a simpler method exists.
Method That Worked: Window A -> postMessage -> Hidden iframe on my domain in window A -> storage apis -> Window B
Is there a way to go directly from window A to window B without a hidden iframe or server side logic?