Cross-domain interstitial collaboration between collaboration pages

Let's say I have two tabs, each of which contains a web page loaded in a different domain. Pages in two tabs want to communicate.

The simplest solution I could see is this one (my answer to a close question I found when looking for duplicates), where one or both pages load an intermediate iFrame page that proxies between postMessage() and localStorage . However, this requires this page to be hosted somewhere, and an additional client request.

Are there any methods for this that do not require a specialized "proxy page" to serve one of the domains? (Ie, which can be implemented by the JavaScript library without a supporting server?)

+9
javascript local-storage cross-domain postmessage
source share
3 answers

This javascript library seems to provide the required functionality (i.e., it supports communication between sources between browser tabs). I have not used this yet, but I will try it in my application. Check out https://github.com/wingify/across-tabs .

0
source share

I would prefer to create an API backend service as a common communication tunnel between two different websites.

Eg. Site-A send a POST message to https://your-API-service When Site-B asks for an update to https://your-API-service Then API service returns the message previously sent from Site-A If you need real-time communication, you can also use WebSockets or push notifications

-one
source share

CrossDomain-Tab-Communication to hear that we need two different domains. let's assume

http://domain1.com http://domoin2.com

Please change http: //XXX---yourDomain--XXX/child.html to http://domoin2.com/child.html http: // XXX --- yourDomain - XXX to http://domoin2.com First, launch your http://domain1.com and click on the “Start Communication” button. If you follow the instructions correctly, you will receive a message about successful connection confirmation. Then you start intercommunicating with both tabs.

Please use this link: https://github.com/amee9451/crossDomain-tab-communication

-2
source share

All Articles