首页 > Windows开发 > 详细

iframe: 报错 DOMException: Failed to read the 'localStorage' property from 'Window':

时间:2020-01-19 17:51:06      阅读:409      评论:0      收藏:0      [点我收藏+]

今天,在 react 项目中使用 iframe,测试 百度网页OK,但使用生产实际的 URL,出现如下报错:

技术分享图片

报错内容:Failed to read the ‘localStorage‘ property from ‘Window‘ : Access is denied for this document.

问题场景:
在Iframe 中引入720全景网页是报错。


解决办法:
Under Chrome‘s Settings > Privacy > Content settings, you have the cookie setting set to to "Block sites from setting any data"

即:

在Chrome设置菜单中: 高级 > 隐私设置和安全性 > 内容设置 > Cookie > 阻止第三方Cookie

将这项关闭,如下图
技术分享图片

 

 

 

iframe: 报错 DOMException: Failed to read the 'localStorage' property from 'Window':

原文:https://www.cnblogs.com/ostrich-sunshine/p/11757622.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!