Tag Archives: Javascript SecurityError

Javascript SecurityError: Failed to read the’localStorage’ property from’Window’: Access is denied for this document.

When using chrome incognito mode, third-party cookies are blocked by defaultĀ 

If local storage or cookie is used, an error will be reported in js

ErrorĀ SecurityError: Failed to read the ‘localStorage ‘ property from ‘Window’: Access is denied for this document.

Failed to read the the’localStorage’ property from windows: Access is denied for this document.

 

This problem can only be handled at the code level to be compatible, and no errors will be reported first.

            if (navigator.cookieEnabled&& typeof window.localStorage !== ' undefined ' ) {
      
            }