GithubHelp home page GithubHelp logo

error's Introduction

前端报错监控

注意,引用此js必须在其他js之前,否则监控不到出错信息

API

config

    $error.config({
        whiteList : [],//域名白名单,即在此域名内才收集报错信息
        blackList : [],//域名黑名单,即在此域名内不收集报错信息
        stackdepth : 3,//收集报错信息的堆栈深度
        beanIcon:''//上报的地址,get请求
    })

monitor

    $error.monitor();//开启监控

注意 对于跨域的JS资源window的onerror拿不到详细的信息,需要往资源的请求的响应头添加额外的头部。

eg:

    //设置Respone Header:头部
    "Respone Header":"Access-Control-Allow-Origin:http://www.xxx.com"
    //同时script引入外链的标签需要加多一个crossorigin的属性,这样才能获取到准确的出错信息。
    <script src="xxx.js" crossorigin></script>

error's People

Contributors

navyxie avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.