1 Star 0 Fork 0

liqc / wrong-report

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

wrong-report

监控前端js报错、静态资源加载、promise的错误信息以及FP、FCP、LCP数据,并通过图片上报错误信息(目前还在测试优化阶段)。

    JS报错,
    静态资源加载报错,
	FP、FCP、LCP,

安装//Install

	npm install wrong-report --save

ES6

	import {initReporting} from 'wrong-report'
	//使用示例:
	initReporting("http://localhost:8080/error")//报错信息提交后台的接口(自己测试的)
	//或者
	initReporting({
		url:"http://localhost:8080/error",
		isSupportObserve:true,//是否开启FP、FCP、LCP监控(默认开启)
		isSupportJS:true,//是否开启js报错监控(默认开启)
	})//报错信息提交后台的接口(自己测试的)

上报示例

   //js上报
	new Image().src =
		`${this.url}?errorMsg=${encodeURIComponent(errorMsg)}&errorURL=${encodeURIComponent(errorURL)}&errorType=${encodeURIComponent(errorType)}&message=${encodeURIComponent(message)}&locationHref=${encodeURIComponent(location.href)}`;
	//FP、FCP、LCP上报	
	new Image().src =
		`${this.url}?entryType=${entryType}&name=${name}&time=${startTime}&locationHref=${encodeURIComponent(location.href)}`				   

空文件

简介

前端监控js报错、静态资源加载报错、promise和ajax请求报错并通过图片上报的插件 展开 收起
JavaScript
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/king_atlantis/wrong-report.git
git@gitee.com:king_atlantis/wrong-report.git
king_atlantis
wrong-report
wrong-report
master

搜索帮助