Skip to content

Instantly share code, notes, and snippets.

View gwuhaolin's full-sized avatar
🎯
Focusing

gwuhaolin gwuhaolin

🎯
Focusing
View GitHub Profile
@gwuhaolin
gwuhaolin / 前端异常监控.md
Last active August 20, 2020 12:13
前端异常监控

前端异常监控

为什么需要前端异常监控

如今Web庞大复杂应用场景广泛,再加上各种浏览器造成的环境差异,很难保证我们的页面呈现给每个用户时都是正常的。稳定和准确是每个产品的基础,对于用户直接交互的页面更加显得重要。我们不能等到用户投诉后才知道出现问题,而是应该主动监控尽快暴露出异常。

前端有哪些异常

  • 静态资源加载异常
    • 网络环境恶劣
    • 运营商劫持
    • 文件丢失
{
"scripts": {
"dev": "webpack-dev-server --hot --open",
"dist": "rm -rf public && NODE_ENV=production webpack --config webpack-dist.config.js --display-optimization-bailout",
"jbdist": "tnpm i && NODE_ENV=production webpack --config webpack-dist.config.js"
},
"dependencies": {
"babel-runtime": "^6.23.0",
"badjs-report": "^1.3.2",
"classnames": "^2.2.5",
@gwuhaolin
gwuhaolin / fis3.d.ts
Last active August 4, 2016 06:51
typescript d.ts file for fis3
/**
* typescript d.ts file for fis3
*/
module fis {
/**
* fis 插件
*/
interface plugin {
}
@gwuhaolin
gwuhaolin / mini-jsonp
Created March 25, 2015 06:55
mini jsonp
function jsonp(url, callback) {
var script = document.createElement('script');
script.type = "text/javascript";
script.src = url + (url.indexOf('?') > 0 ? '&' : '?') + 'callback=CB&' + Date.now();
script.onload=function(){
script.parentNode.removeChild(script);
};
window['CB'] = function (json) {
callback(json);