Microsoft Edge:本地/会话存储在新选项卡中不起作用 [英] Microsoft Edge: local/session storage are not working in a new tab

查看:156
本文介绍了Microsoft Edge:本地/会话存储在新选项卡中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理Azure中托管的Web应用程序.我已经在MS Edge(内部版本20.10525.0.0)上进行了尝试,并遇到了以下问题.

I'm working on a Web Application hosted in Azure. I've tried it on MS Edge (build 20.10525.0.0) and got the following problem.

我有一个与目标_blank的链接,用于在新标签页中打开一个页面.关于此链接的click事件,我将一些数据存储在会话存储中.新页面正在检索数据以显示它.在Chrome,Firefox,IE 9-10-11下可以正常工作.

I have a link with target _blank to open in a new tab a page. On the click event of this link, I store some data in the session storage. The new page is retrieving the data to display it. This work fine under Chrome, Firefox, IE 9-10-11.

在Edge下,存储似乎工作正常.认为,检索并非总是有效.有时,第一次尝试有效.有时,它返回null.

Under Edge, the storage seems to work fine. Thought, the retrieving is not always working. Sometimes, the first attempt works. Sometimes, it returns null.

我尝试使用本地存储代替会话存储.我也尝试使用window.open代替目标_blank.这两种解决方案均无效.

I've tried to use the local storage instead of session storage. I've also tried to use window.open instead to the target _blank. Both of these solutions are not working.

有人有想法吗?

推荐答案

我在多个选项卡上都遇到了localStorage的相同问题-它只能间歇性地工作,或者根本不能工作.我的解决方案是切换到window.indexedDB(请参阅MDN上的 docs )在IE10,IE11和MS Edge(在Edge v20.10240上进行了测试)上都可以正常工作.

I had the same problem with localStorage across multiple tabs - it would only work intermittently, or not at all. My solution was to switch to window.indexedDB (see docs on MDN) which works fine in IE10, IE11 and MS Edge (tested on Edge v20.10240).

这篇关于Microsoft Edge:本地/会话存储在新选项卡中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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