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 ' ) { }
Read More:
- Javascript: Simple package localStorge operation
- Localstorage sets the expiration time.
- [Solved] IE Browser Error: unhandled promise rejection error: access is denied. File stream Download
- How to Test whether the property value of each property in the object is not empty
- Uni-app Error when assigning a value to a component: [system] TypeError: Cannot read property ‘name‘ of undefined
- [Solved] Cannot read property ‘setCheckedKeys‘ of undefined“
- Cannot read property ‘isFile‘ of undefined [How to Solve]
- [Solved] Vuepress Package Error: document is not defined
- Vue cannot read property ‘xxx’ of undefined solutions
- [Solved] electron Error: Uncaught TypeError: Cannot read property ‘BrowserWindow‘ of undefined
- JS bug Log Uncaught TypeError: Cannot read property ‘previoustSibling‘ of null
- [Solved] HBuilder Error: Cannot read property ‘forceUpdate‘ of undefined
- [Solved] Syntax Error: TypeError: Cannot read property ‘parseComponent‘ of undefined
- [Solved] Syntax Error: TypeError: Cannot read property ‘parseComponent‘ of undefined
- [Solved] Vue element UI form verification error: cannot read property ‘validate’ of undefined
- [Solved] Install The Latest Version of Jest Error: TypeError: Cannot read property ‘instrument‘ of undefined
- [Solved] TYPEERROR: CANNOT READ PROPERTY ‘REDUCE‘ OF UNDEFINED
- [Solved] Echarts Error: Cannot read property ‘init‘ of undefined
- [Solved] Uni.createintersectionobserver Error: Uncaught TypeError: Cannot read property ‘bottom’ of null
- [Solved] Error in callback for watcher “value“: “TypeError: Cannot read property ‘level‘ of null“