JavaScript localStorage object broken in IE11 on Windows 7

后端 未结 4 1706
醉话见心
醉话见心 2020-11-27 04:08

The localStorage object in Internet Explorer 11 (Windows 7 build) contains string representations of certain functions instead of native calls as you would expe

4条回答
  •  渐次进展
    2020-11-27 05:12

    In addition to the already excellent answers here, I'd like to add another observation. In my case, the NTFS permissions on the Windows %LOCALAPPDATA% directory structure were somehow broken.

    To diagnose this issue. I created a new Windows account (profile), which worked fine with the localStorage,so then I painstakingly traversed the respective %LOCALAPPDATA%\Microsoft\Internet Explorer trees looking for discrepancies.

    I found this gem:

    C:\Users\User\AppData\Local\Microsoft>icacls "Internet Explorer"
    Internet Explorer Everyone:(F)
    

    I have NO idea how the permissions were set wide open!

    Worse, all of the subdirectories has all permissions off. No wonder the DOMStore was inaccessible!

    The working permissions from the other account were:

     NT AUTHORITY\SYSTEM:(OI)(CI)(F)
     BUILTIN\Administrators:(OI)(CI)(F)
     my-pc\test:(OI)(CI)(F)
    

    Which matched the permissions of the parent directory.

    So, in a fit of laziness, I fixed the problem by having all directories "Internet Explorer" and under inherit the permissions. The RIGHT thing to do would be to manually apply each permission and not rely on the inherit function. But one thing to check is the NTFS permissions of %LOCALAPPDATA%\Microsoft\Internet Explorer if you experience this issue. If DOMStore has broken permissions, all attempts to access localStorage will be met with Access Denied.

提交回复
热议问题