• Stars
    star
    1,382
  • Rank 34,014 (Top 0.7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

1kb js library contains development debugging, error monitoring and reporting, user problem localization features - 1KB代码搞定开发调试发布,错误监控上报,用户问题定位

中文 | English

AlloyLever

1kb(gzip)代码搞定开发调试发布,错误监控上报,用户问题定位。

  • 支持错误监控和上报
  • 支持 vConsole错误展示
  • 支持开发阶段使用 vConsole
  • 支持生产环境机关拉取 vConsole
  • 支持预埋机关唤起
  • 支持url带参数唤起

url带参数唤起有两个目的,第一是方便网站开发过程中显示vConsole面板,第二是发给投诉反馈网站错误的用户显示vConsole面板用于定位错误。

安装

npm install alloylever

CDN地址下载下来使用:

https://unpkg.com/alloylever

使用指南

AlloyLever.config({
    cdn:'//s.url.cn/qqun/qun/qqweb/m/qun/confession/js/vconsole.min.js',  //vconsole的CDN地址
    reportUrl: "//a.qq.com",  //错误上报地址
    reportPrefix: 'qun',    //错误上报msg前缀,一般用于标识业务类型
    reportKey: 'msg',        //错误上报msg前缀的key,用户上报系统接收存储msg
    otherReport: {              //需要上报的其他信息
        uin: 491862102
    },
    entry:"#entry"          //请点击这个DOM元素6次召唤vConsole。//你可以通过AlloyLever.entry('#entry2')设置多个机关入口召唤神龙
})

AlloyLever会监听window.onerror并把错误信息保存下来,并且上报到reportUrl,你也可以召唤到vConsole并显示出来错误和相关日志。 或者使用这个CDN也可以://pub.idqqimg.com/qqun/qun/qqweb/m/qun/confession/js/vconsole.min.js

url唤起vConsole

只要你的页面引用了AlloyLever,你只需要在你的url里带上 vconsole=show 就能显示vConsole面板。如:

//加载并显示log面板
http://localhost:63342/AlloyLever/index.html?vconsole=show
//加载但不显示log面板
http://localhost:63342/AlloyLever/index.html?vconsole=hide
//不加载vConsole脚本
http://localhost:63342/AlloyLever/index.html

这些url的作用很好理解:

  • 开发阶段用于调试
  • 发给投诉的用户打开带有vconsole=show的url

在线演示

QQ交流群491862102

English | 中文

AlloyLever

1kb(gzip) js library contains development debugging, error monitoring and reporting, user problem localization features.

  • support error monitoring and reporting
  • support for vConsole error display
  • support the development phase by using vConsole
  • support the production environment authorities to pull vConsole
  • support DOM evokes vConsole
  • supports url evokes vConsole

There are two purposes for URL parameter arousal, the first is to display the vConsole panel during the website development process, and the second is to send a complaint to the feedback site. The wrong user displays the vConsole panel for locating errors.

Install

npm install alloylever

or get it from cdn:

https://unpkg.com/alloylever

Usage

AlloyLever.config({
    cdn:'//s.url.cn/qqun/qun/qqweb/m/qun/confession/js/vconsole.min.js',  //vconsole CDN address
    reportUrl: "//a.qq.com",  //Error reporting address
    reportPrefix: 'qun',    //An error reporting msg prefix is generally used to differentiate business types
    reportKey: 'msg',        //Error reporting msg prefix key, user reporting system receives storage msg
    otherReport: {              //Other information to be reported
        uin: 491862102
    },
    entry:"#entry"          //Please click on this DOM element to summon vConsole 6 times. You can use AlloyLever.entry('#entry2') add more entry
})

AlloyLever will listen to window.onerror and save the error information, and report to reportUrl, you can also call vConsole and display errors and related logs.

URL evokes vConsole

As long as your page references AlloyLever, you simply display the vConsole panel with the vconsole=show in your url. Such as:

//load and display the log panel
http://localhost:63342/AlloyLever/index.html?vconsole=show
//load but don't display the log panel
http://localhost:63342/AlloyLever/index.html?vconsole=hide
//don't load vConsole
http://localhost:63342/AlloyLever/index.html

The role of these URL is well understood:

  • development phase for debugging
  • open the URL with vconsole=show to the user who has complained

DEMO

License

This content is released under the MIT License.

More Repositories

1

Mars

腾讯移动 Web 前端知识库
9,612
star
2

AlloyFinger

Super tiny size multi-touch gestures library for the web.    You can touch this →
JavaScript
3,418
star
3

AlloyImage

基于HTML5的专业级图像处理开源引擎。An image processing lib based on html5.
JavaScript
3,018
star
4

PhyTouch

Smooth scrolling, rotation, pull to refresh, page transition and any motion for the web - 丝般顺滑的触摸运动方案
JavaScript
2,968
star
5

eslint-config-alloy

Progressive ESLint config for your React/Vue/TypeScript projects
JavaScript
2,641
star
6

curvejs

Made curve a dancer in HTML5 canvas - 魔幻线条
JavaScript
1,303
star
7

CodeGuide

Alloyteam代码规范
HTML
1,279
star
8

JX

JX(Javascript eXtension tools) 是腾讯AlloyTeam推出的模块化、非侵入式Web前端框架,适合构建和组织工业级大规模、高效率的 Web App
JavaScript
1,153
star
9

AlloyCrop

The best and tiny size mobile cropping component - 做最好且最小的移动裁剪组件
JavaScript
941
star
10

Rythem

a fiddler-like project using Qt
C++
888
star
11

alloyteam.github.com

腾讯 AlloyTeam 开源项目官网 - 我们的愿景: 成为业界卓越的Web团队!
JavaScript
849
star
12

alloy-worker

面向事务的高可用 Web Worker 通信框架
TypeScript
644
star
13

AlloyStick

AlloyStick 骨骼动画引擎 - 腾讯 AlloyTeam
JavaScript
437
star
14

Rosin

A tool for web developers debug mobile page with fiddler. http://alloyteam.github.io/Rosin/
C#
312
star
15

StreetFighter

街霸StreetFighter
JavaScript
305
star
16

webtop

HTML5 本地App开发引擎
C++
290
star
17

AlloyPhoto

JavaScript
277
star
18

gopng

GoPng - a HTML5 css sprite generator with cool feature.
273
star
19

sodajs

Light weight but powerful template engine for JavaScript
JavaScript
257
star
20

tslint-config-alloy

AlloyTeam TSLint 规则
JavaScript
205
star
21

JXAnimate

基于CSS3的并行动画、声音引擎 - JX.Animate
CSS
195
star
22

AlloyTimer

AlloyTimer定时器 - 番茄工作法的时间管理应用
JavaScript
195
star
23

JMUI

移动Web开发UI组件库
JavaScript
178
star
24

AlloyViewer

H5图片查看器—Imageview component built with react
JavaScript
176
star
25

JM

面向Mobile的极致JavaScript库
JavaScript
141
star
26

AlloyDesigner

AlloyDesigner是一款致力于提高前端生产效率的浏览器内运行工具,AlloyDesigner + Chrome F12(Especially with WorkSpace) 打造前端新的开发和测试模式
138
star
27

omi-cli

Create website with no build configuration - 创建网站无需任何配置
JavaScript
125
star
28

AlloyPullRefresh

JavaScript
119
star
29

Spirit

腾讯移动Web整体解决方案
CSS
117
star
30

CodeTank

CodeTank(代码坦克)是全世界首款 Javascript 程序员的游戏, 由腾讯 AlloyTeam 用 HTML5、Javascript 等 Web 新技术来构建一个基于互联网的智能坦克机器人战斗仿真引擎
114
star
31

AlloyClip

A PC & Mobile Image Clip Kit based on AlloyImage
JavaScript
108
star
32

MLogger

一个浮在页面上的日志查看工具
JavaScript
100
star
33

Abstract.js

Abstract.js is a web framework for fast development
JavaScript
46
star
34

AlloyLint

apply eslint autofix but keep last author info in git blame。运行 eslint 的自动修复,但是保留最后修改人的信息
TypeScript
41
star
35

AlloyFlow

made workflow simple
JavaScript
38
star
36

AlloyTicker

The Master of Time          DEMO
JavaScript
25
star
37

netural

JavaScript前向神经网络(推理)和反向传播(训练)的实现
JavaScript
22
star