zendesk / cross-storage

Cross domain local storage, with permissions
Apache License 2.0
2.22k stars 180 forks source link

Failed to execute 'postMessage' on 'DOMWindow' #40

Closed venkataramkishore closed 7 years ago

venkataramkishore commented 7 years ago

I have several apps to support with same login details. When client page is trying to communicate to target hub page i am getting following error: Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('http://localhost:3001') does not match the recipient window's origin i have client setup as CrossStorageHub.init([ {origin: /localhost:3000$/, allow: ['get', 'set', 'del', 'getKeys', 'clear']}, {origin: /localhost:3001$/, allow: ['get', 'set', 'del', 'getKeys', 'clear']}, {origin: /localhost:3002$/, allow: ['get', 'set', 'del', 'getKeys', 'clear']}, {origin: /localhost:3003$/, allow: ['get', 'set', 'del', 'getKeys', 'clear']}, {origin: /localhost:3004$/, allow: ['get', 'set', 'del', 'getKeys', 'clear']}, {origin: /localhost:3005$/, allow: ['get', 'set', 'del', 'getKeys', 'clear']}, {origin: /localhost:3006$/, allow: ['get', 'set', 'del', 'getKeys', 'clear']}, {origin: /localhost:3007$/, allow: ['get', 'set', 'del', 'getKeys', 'clear']}, {origin: /localhost:3008$/, allow: ['get', 'set', 'del', 'getKeys', 'clear']} ]);

image

Please help me i am not able to identify the issue

danielstjules commented 7 years ago

Is it possible you have both client/hub on the same page? Can you share your client code?

venkataramkishore commented 7 years ago

Hey sorry its my bad!! there was issue with proxy in our env thats why it didnt work. It still seems to be inconsistency but it worked :) +1: