我通过 REACT js 开发了混合应用程序。它在桌面和应用程序上运行良好。但它不适用于任何浏览器私有(private)窗口的设备(Ipad 或手机)。问题是,我无法仅在设备的私有(private)窗口中获取或设置 localStorage
值。如何获取 LocalStorage
值?
最佳答案
本地存储在 ios 上的私有(private)模式下被禁用。即使在正常模式下,localstorage 也可以“随机”删除。
这里是关于 developer.mozilla.org 的段落
Note: Starting with iOS 5.1, Safari Mobile stores localStorage data in
the cache folder, which is subject to occasional clean up, at the behest
of the OS, typically if space is short. Safari Mobile's Private Browsing
mode also prevents writing to localStorage entirely.
关于javascript - 本地存储不适用于 iPad 浏览器私有(private)窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46684403/