error-catcher-self

0.0.3 • Public • Published

errorcatch-chjrome-extension

错误采集浏览器插件

  1. 引入打包好的 index.js 或支持 umd import

  2. 在页面初始化完成

window.onload = async function () {
  const plugin = new CatchPlugin({
    projectId: '1693', // 项目ID
    url: 'http://baidu.com', // 平台接口地址 或 url: ''
  });
  plugin.init().then(() => plugin.listen());
};
import CatchPlugin from 'xxxx'
useEffect(() => {
  const plugin = new CatchPlugin({
    projectId: '1693', // 项目ID
    url: 'http://10.45.46.15:10000', // 或 url: ''
  });
  plugin.init().then(() => plugin.listen());

  return () => plugin.stop();
}, []);

设置了 URL 如配置获取完整的会拼接 url+ '/autotest-web/exceptionCatcher/getExceptionCatcherConfig'

没有设置默认即 url: '' 域名 /autotest-web/exceptionCatcher/getExceptionCatcherConfig

  1. 卸载取消dom监听 plugin.stop();

Readme

Keywords

none

Package Sidebar

Install

npm i error-catcher-self

Weekly Downloads

0

Version

0.0.3

License

none

Unpacked Size

892 kB

Total Files

35

Last publish

Collaborators

  • cwz