Why does accessing the localStorage object in Internet Explorer throw an error?

杀马特。学长 韩版系。学妹 提交于 2019-12-05 14:12:10

I've discovered if the lowest level subdomain matches one of the reserved device names as documented at Restrictions on the File Mask and File Name Properties on Internet Explorer then accessing the localStorage object will throw an error.

This problem is likely happening because internally Internet Explorer is attempting to access the file system using a reserved device name when accessing the localStorage object in order to satisfy the Storage object initialization steps.

It's certainly very much an edge case but if your page is comes from a server whose lowest level subdomain is exactly any of con, prn, aux, clock$, nul, com1, com2, com3, com4, com5, com6, com7, com8, com9, lpt1, lpt2, lpt3, lpt4, lpt5, lpt6, lpt7, lpt8, or lpt9 (e.g. http://prn.example.com) then this could well the reason why you are seeing this problem.

Choosing a lower level subdomain that wasn't a reserved device name in this situation solved the problem.

We hit a similar issue because we ran CCleaner on the machine.

To solve:

Internet Options -> Browsing History -> Delete:

Make sure to check all options except the very first one (Preserve Favorite website data).

We were able to fix, then reproduce this issue by using CCleaner again, then fix again.

Go to this site for more information: http://grekai.wordpress.com/2013/02/24/localstorage-the-system-cannot-find-the-path-specified/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!