zoukankan      html  css  js  c++  java
  • [javascript] 报错SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.

    当使用chrome 无痕模式时, 默认阻止第三方cookie 

    如果使用了localStorge或者cookie , 就会在js里报错

    报错SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.

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

    这个问题只能在代码层面做兼容处理 ,先不让报错

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

     

    开源作品

    GO-FLY,一套可私有化部署的免费开源客服系统,安装过程不超过五分钟(超过你打我 !),基于Golang开发,二进制文件可直接使用无需搭开发环境,下载zip解压即可,仅依赖MySQL数据库,是一个开箱即用的网页在线客服系统,致力于帮助广大开发者/中小站长快速整合私有客服功能
    github地址:go-fly
    官网地址:https://gofly.sopans.com

    赞赏作者

    微信交流

  • 相关阅读:
    LinkLabel控件使用
    读取mysql代码片段
    设置点风格
    C# List 用法
    图片焦点图切换效果
    dreamweaver 泛泛之谈
    js 之for..in、表单及事件触发
    实现省份查询 功能
    input类主要是
    js (1)
  • 原文地址:https://www.cnblogs.com/taoshihan/p/14536446.html
Copyright © 2011-2022 走看看