我们可以使用两个页面之间的IndexdDB对象存储吗 [英] Can we use IndexdDB objects stores between two pages

查看:146
本文介绍了我们可以使用两个页面之间的IndexdDB对象存储吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的页面中创建了一个IndexdDB对象存储库(让对象存储库名称为"ShopStore").现在,我想从另一个页面打开相同的对象存储.有可能吗?

I have created a IndexdDB object store in my one page (Let object store name is "ShopStore"). Now I want to open the same object store from a diffirent page. Is it possible?

我的两个网页位于不同的域.

My two web pages are on different domain.

推荐答案

根据

According to MDN you can't do cross domain access to an indexedDB (for security reason, you don't want that another website modify your client database):

IndexedDB遵循同源策略.因此,尽管您可以访问域中存储的数据,但不能跨不同域访问数据.

IndexedDB follows a same-origin policy. So while you can access stored data within a domain, you cannot access data across different domains.

另请参阅:

  • cross domain reading data from browser storage
  • Is it possible for a Chrome extension to access an IndexedDB database created by a specific domain?

这篇关于我们可以使用两个页面之间的IndexdDB对象存储吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆