2017-03-17 87 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. 
相關問題