2017-03-17 175 views
0

xxx.com如何访问yyy.com的indexeddb。
这2个域名包含相同的脚本 是否有可能。“Cross Domain IndexedDB”是否可能

Iframe技术可能吗?

+3

的可能的复制[我们可以使用IndexdDB对象两个页面之间专卖店(http://stackoverflow.com/questions/23874290/can-we-use-indexddb-objects-stores-between-two-pages ) - TL; DR,不,因为让这种事情发生的可怕性不足。 –

回答

0
You can do it with iframe technique (loading iframe with same domain in different domains) 

example: 
myStorageIframe.com 
a.com 
b.com 
c.com 

you can add the iframe to each domain, and store/get items with post-message. 
each domain will communicate with the frame, and by this the storage will be shared between all domains. 

The pitfalls of this is that in Safari it will make a lot of problems, since their security policy is very strict with cross-domain & third-party storages.