krakenjs / post-robot

Cross domain post-messaging on the client side using a simple listener/client pattern.
Apache License 2.0
741 stars 92 forks source link

Not working on newer versions of Google Chrome? #92

Open deathg0d opened 3 years ago

deathg0d commented 3 years ago

Post robot on a cross domain iframe does not seem to be working on newer versions of Chrome anymore. It works fine on firefox.

Code for listener:

In html:
<iframe id="deferredIframe" src="http://anotherdomain/url" class="is-hidden" src="about:blank" />

In js:
postRobot.on('getInfo', { window: deferredIframe.contentWindow }, function(event) {
    console.log(event.data)
    ....

the listener page has an iframe with a link to another domain that run a post robot send function:

inside http://anotherdomain/url:

postRobot
         .send(window.parent, "getInfo", { ... data ... })
         .then(function(event) {
            console.log('cross domain transfer successful', event.data);
         })
         .catch(function(err) {
            ...
         });
deathg0d commented 3 years ago

Just to add to the issue. This is working fine for subdomains. However, if the domains are completely different it does not work.

jasan-s commented 3 years ago

Is this still an issue?

deathg0d commented 3 years ago

yes :(